79262666

Date: 2024-12-08 14:41:39
Score: 1
Natty:
Report link

If your $(which mv) version supports -b then the code below is ok, otherwise edit the function with alternative temporary file strategy.

# define alias fswap

alias fswap='function _fswap () { mv -b ${1} ${2} && mv ${2}~ ${1}; }; _fswap'

# usage

fswap file1 file2
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: rmixarelli