B / Y / U / S
HOME À¥ È£½ºÆà µµ¸ÞÀÎ ¸Å´º¾ó °í°´Áö¿ø ¼³Á¤Á¤º¸ °èÁ¤½Åû 2024-12-30 Monday 
À¥ È£½ºÆÃ
# °øÁö »çÇ×
# ÀÚÁÖ ¹¯´Â Áú¹®
# Áú¹®°ú ´äº¯
# °¡ÀÔ ¹®ÀÇ
Ä¿¹Â´ÏƼ
# ÀÚÀ¯°Ô½ÃÆÇ
# ¸®´ª½ºÆÁ
# ¾ÆÀÌÅ¥ Å×½ºÆ®
# ³»È¨ ¼Ò°³
# °Ö·¯¸®
# ÀÚ·á½Ç

  ¸®´ª½ºÆÁ  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

[ °ü·Ã±Û ]


180 ƯÁ¤ µðºñ ÃʱâÈ­ bash ½ºÅ©¸³Æ®  Ç®ºñ´©  2002.12.29  .2957 
Regist Addr [ 210.219.138.57 ] ¸ñ·Ïº¸±â À­±Û ¾Æ·§±Û
Á¤±ÔÇ¥Çö½Ä [ »ó¼¼ °Ë»ö ]
Page Loading [ 0.03 Sec ] SQL Time [ 0 Sec ]

Copyleft 1999-2024 by JSBoard Open Project
Theme Designed by IDOO And follow GPL2

°³ÀÎÁ¤º¸ Ãë±Þ¹æħ ÀÌ¿ë ¾à°ü »çÀÌÆ® ¸Ê ¾îµå¹Î °ü¸®