|
|
|
¸®´ª½ºÆÁ Go Unix Power Tools Online Book
Go Bash Guide
|
|
Read No. 180 article |
2002-12-29 01:49:48 |
|
|
|
|
NickName |
Ç®ºñ´© |
Subject |
ƯÁ¤ µðºñ ÃʱâÈ bash ½ºÅ©¸³Æ® |
|
|
#!/bin/bash
# root ½ÇÇà - /etc/my.cnf ÂüÁ¶ from byus.net
if [ $1 ]; then
dbname=$1
else
echo
echo -n "### ÃʱâÈÇÒ µðºñ¸íÀ» ÀûÀ¸¼¼¿ä : "
read dbname
if [ ! $dbname ] ; then exit 0 ; fi
fi
DBS=$(mysql $dbname -e"show tables"|grep -v "Tables_in_")
if [ ! $DBS ]; then echo ">>> µðºñ°¡ ±ú²ýÇÑ »óÅ·ΠÀÌ¹Ì ÃʱâÈµÈ »óÅÂÀÔ´Ï´Ù."
else
if for list in $DBS ;
do
echo "Deleted Table - $list"
mysql $dbname -e"drop table $list"
done
then echo ">>> $dbname ÀÌ ÃʱâÈ µÇ¾ú½À´Ï´Ù"
else echo ">>> $dbname ÃʱâÈ¿¡ ½ÇÆÐÇÏ¿´½À´Ï´Ù"
fi
fi
[ °ü·Ã±Û ]
|
|
Page Loading [ 0.03 Sec ]
SQL Time [ 0 Sec ]
|
|
|