-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreateDatabase.sh
More file actions
executable file
·30 lines (28 loc) · 863 Bytes
/
Copy pathcreateDatabase.sh
File metadata and controls
executable file
·30 lines (28 loc) · 863 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
#!/bin/bash
printf "\n"
echo -e "${BBlue}#####################"
echo "## Create Database ##"
echo -e "#####################${Color_Off}"
printf "\n"
while [ true ]
do
printf "${BCyan}Enter Database Valid Name uppercase and lowercase letters only ==> ${Color_Off}"
read databaseName
if [[ ${databaseName} =~ ^[a-z*A-Z*]+$ ]]
then
find ./DataBases -type d -name ${databaseName} | grep ${databaseName} 2>&1 >/dev/null
if (($?==0))
then
echo -e "${Red}database already Exists!!!${Color_Off}"
else
mkdir ./DataBases/${databaseName}
break
fi
else
echo -e "${Red}Enter a valid database Name${Color_Off}"
fi
done
echo -e "${Green}Successfully created new database with the name ${databaseName}${Color_Off}"
printf "\n"
source ./divide.sh
source ./mainMenu.sh