Created
August 28, 2012 10:55
-
-
Save lslinnet/3497188 to your computer and use it in GitHub Desktop.
Bash based swap command to swap 2 directories
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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