2013. 11. 20. 13:40
#!/bin/bash
Result=`mysql -u userId -puserPw --skip-column-names -e "show databases like 'database_name'"`
if [ "$Result" != "database_name" ]; then
echo "Database isn't exist"
else
echo "Database is exist"
fi
'Programming > Bash shell' 카테고리의 다른 글
calculateion in bash shell (0) | 2013.11.20 |
---|---|
check wheter mySQL is running in bash shell (0) | 2013.11.20 |
Using shell script to control in mySQL (0) | 2013.11.19 |
optional parameter expansions in bash shell (0) | 2013.11.19 |
Replace string in bash shell (0) | 2013.11.18 |