-
Notifications
You must be signed in to change notification settings - Fork 0
/
menu.sh
executable file
·56 lines (52 loc) · 1.29 KB
/
menu.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
clear
echo "Menu "
echo "0. List files"
echo "1. Copy a File "
echo "2. Remove a file "
echo "3. Move a file"
echo "4. Quit"
echo "Enter your Choice"
read Choice
case "$Choice" in
0) echo "list files"
ls -la | tee;;
1) echo "Enter 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 the File to be removed "
read r1
if [ -f r1 ]
then
rm -i $r1
else
echo "$r1 file does not exist "
fi
;;
3)
echo "Enter File name to move"
read s1
echo "Enter destination"
read s2
if [ -f s1 ]
then
if [ -d s2 ]
then
mv $s1 $s2
fi
else
echo "$s1 does not exist"
fi
;;
4)
echo "Exit......."
exit;;
esac