Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- if [ "$1" == "-n" ]
- then
- cd /home/ian/dustbin
- restore =`grep $2 /home/ian/store`
- filename = `basename "$restore"`
- echo "Where do you want to save to?"
- read location
- location1 = `readlink -f $location`
- if [[ -e "$filename" ]]; then
- echo FILE NOT FOUND
- fi
- mv -i $filename "$location1"/$filename
- else
- ##if the restore script is run without the -n switch the file will be restored to its original location
- cd /home/ian/dustbin
- restore = `grep $1 /home/ian/store`
- filename=`basename "$restore"`
- if [[ -e "$filename" ]]; then
- echo FILE NOT FOUND
- fi
- mv -i $filename $location
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement