Skip to content

Instantly share code, notes, and snippets.

@yangadam
Created October 15, 2015 15:18
Show Gist options
  • Save yangadam/e7413cd6834023c4e809 to your computer and use it in GitHub Desktop.
Save yangadam/e7413cd6834023c4e809 to your computer and use it in GitHub Desktop.
#!/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