|
|
|
¸®´ª½ºÆÁ Go Unix Power Tools Online Book
Go Bash Guide
|
|
Read No. 190 article |
2003-06-06 07:30:27 |
|
|
|
|
NickName |
Ç®ºñ´© |
Subject |
ƯÁ¤ µðºñ »çÀÌÁî È®ÀÎ ½ºÅ©¸³Æ® |
|
|
#!/bin/bash
if [ $(whoami) = "root" ]; then
echo -n "### DBNAME : " ; read dbname
for i in $(mysql -e "use $dbname; show table status;"|awk \
'{print $6,$8}'|sed -ne '/[0-9]/p');do
size=$(( $size + $i ))
done
else
echo -n "### DBNAME : " ; read dbname
echo -n "### DBUSER ( default $dbname ) : " ; read dbuser
[ ! $dbuser ] && dbuser=$dbname
echo -n "### DBPASS : " ; read dbpass
for i in $(mysql -u$dbuser -p$dbpass -e "use $dbname; show \
table status;"|awk '{print $6,$8}'|sed -ne '/[0-9]/p');do
size=$(( $size + $i ))
done
fi
echo "µðºñ »çÀÌÁî : $size bytes"
|
|
Page Loading [ 0.02 Sec ]
SQL Time [ 0 Sec ]
|
|
|