Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I keep meaning to generalize this (directory target, multiple sources, flags), but I get quite a bit of mileage out of this `unmv` script even as it is:

  #!/bin/sh
  if test "$#" != 2
  then
      echo 'Error: unmv must have exactly 2 arguments'
      exit 1
  fi
  exec mv "$2" "$1"


How do you use it so it's more ergonimic than typing arguments manually reversed? `unmv !$` ?


Nice. This can be generalized to a ”mirror” command to swap the arguments of anything.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: