On Thu, Nov 16, 2017 at 7:18 AM, Jim Meyering wrote: > On Thu, Nov 16, 2017 at 2:37 AM, Bruno Haible wrote: >> Paul Eggert wrote: >>> > + ln -f "$file" "$file~" 2>/dev/null || cp -f "$file" "$file~" || { >>> >>> This will be problematic if the destination already exists, as the >>> resulting permissions etc. may not be what the user intend. How about if >>> we fall back on "mv -f" instead? Although this has the disadvantage of >>> having a small window where "$file" does not exist, I think that's >>> preferable to the disadvantage of using "cp". P.S., thanks to both of you for the reviews and suggestions. FYI, I've also pushed this: