Created
July 3, 2012 14:08
-
-
Save pcon/3039929 to your computer and use it in GitHub Desktop.
swap function
This file contains hidden or 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() { | |
TMP_NAME="TMP_$RANDOM" | |
mv "$1" "/tmp/$TMP_NAME" && mv "$2" "$1" && mv "/tmp/$TMP_NAME" "$2" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment