-
Notifications
You must be signed in to change notification settings - Fork 0
/
connectdb.sh
44 lines (37 loc) · 1.01 KB
/
connectdb.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
#!/bin/bash
echo "-------------------------------connect to database---------------------------"
read -p "enter db_name to connect :" db_name
if [[ -d $db_name ]]; then
cd $db_name
echo "you are connected $db_name"
select name in createtb listtb droptb insertintotb selectfromtb deletefromtb updatetb
do
case $name in
"createtb" )
. ./ create_table.sh
;;
"listtb" )
. ./ list_table.sh
;;
"droptb" )
. ./ drop_table.sh
;;
"insertintotb" )
. ./ insert_into_table.sh
;;
"selectfromtb" )
. ./ select_from_table.sh
;;
"deletefromtb" )
. ./ delete_from_table.sh
;;
"updatetb" )
. ./ update_table.sh
;;
* )
esac
done
else
echo "disconnect database"
fi
. main.sh