Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # A script to 'swap' two file names
- set -euo pipefail
- if [[ $# -ne 2 ]];
- then
- echo "Two arguments required: File1 File2"
- exit 1;
- fi
- echo -n "Swapping $1, $2"
- temp=$(mktemp)
- mv "$1" "$temp"
- mv "$2" "$1"
- mv "$temp" "$2"
- echo ": DONE"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement