Created
October 15, 2015 15:18
-
-
Save yangadam/e7413cd6834023c4e809 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
# reverse.sh | |
if [ $# -eq 0 ]; then | |
echo "No input log file." | |
exit | |
fi | |
if [ -f $1 ]; then | |
filecnt=0 | |
while read -r dest | |
do | |
read -r src | |
mv $src $dest | |
((filecnt++)) | |
done < $1 | |
echo "Restore $filecnt files." | |
rm $1 | |
else | |
echo "File not exists." | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment