Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while true;
- do
- echo "menu"
- echo "1. copy file"
- echo "2. remove file"
- echo "3. move file"
- echo "4. quit"
- echo "5. enter your choice"
- read choice
- case "$choice" in
- 1)
- echo "entr file name to copy"
- read f1
- echo "enter file name"
- read f2
- if [ -f $f1]
- then
- cp $f1 $f2
- else
- echo "$f1 does not exist"
- fi
- ;;
- 2)
- echo "enter file to remove"
- read f1
- if [ -f $f1]
- then
- rm -i $f1
- else
- echo "$f1 does not exist"
- fi
- ;;
- 3)
- echo "enter file name to move"
- read f1
- echo "enter destination"
- read f2
- if [ -f $f1]
- then
- if [ -d $f2]
- then
- mv $f1 $f2
- else
- echo "$f1 does not exist"
- fi
- ;;
- 4)
- echo "exit"
- exit
- ;;
- esac
- done
Advertisement
Add Comment
Please, Sign In to add comment