On 11/15/2017 09:32 PM, Jim Meyering 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? Althoug 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".




Reply via email to