Skip to content

Instantly share code, notes, and snippets.

@lslinnet
Created August 28, 2012 10:55
Show Gist options
  • Save lslinnet/3497188 to your computer and use it in GitHub Desktop.
Save lslinnet/3497188 to your computer and use it in GitHub Desktop.
Bash based swap command to swap 2 directories
function swap()
{
local TMPFILE=tmp.$$
mv "$1" $TMPFILE
mv "$2" "$1"
mv $TMPFILE "$2"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment