-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdropTable.sh
More file actions
executable file
·47 lines (46 loc) · 956 Bytes
/
dropTable.sh
File metadata and controls
executable file
·47 lines (46 loc) · 956 Bytes
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
#!/bin/bash
export LC_COLLATE=C #To sort ascii character
shopt -s extglob #import Advanced Regex
echo "Please Select 1 Or 2: "
select dropOption in "Drop Table" "Back"
do
case $dropOption in
"Drop Table" )
echo "Tables List"
ls -F ./ | sed -n '/meta_/!p'
echo "Please Enter the table name you want to drop: "
read tableName
if [[ -f $tableName ]]
then
echo "Please Select 1 If You Are Sure and 2 To Cancel"
select s_op in "Yes" "Cancel"
do
case $s_op in
"Yes" )
rm -rf $tableName meta_$tableName
echo "Table was dropped successfully"
. ../../tableMenu.sh
;;
"Cancel" )
echo "Drop Table was cancelled"
. ../../tableMenu.sh
;;
* )
echo "Please Enter Valid Numbers"
;;
esac
done
else
echo "Table $tableName not found or invalid"
. ../../dropTable.sh
fi
;;
"Back" )
echo "Backed To Table Menu"
. ../../tableMenu.sh
;;
* )
echo "Please Enter Valid Numbers"
;;
esac
done