Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Linux Shell ±Ê¼Ç¶þ(Ñ­»·½á¹¹)

³ÌÐò12£ºÀàËÆjava ÀïÃæµÄswitch case
[root@localhost scripts]# cat sh12.sh
read -p "input comand:" command
case $command in
"fix")
echo "fix system"
;;
"fuck")
echo "fuck you"
;;
*)
echo "what a stupid man!ex>$0 some word"
esac
exit 0

³ÌÐò13£º¼òµ¥¼òµ¥£¬³¬¼¶¼òµ¥µÄÒ»¸öº¯Êý
[root@localhost scripts]# cat sh13.sh
function printit()
{
echo -n "Your choice is $1"
}
#$1Ϊ¿ØÖÆÌ¨ÊäÈëµÄµÚ¶þ¸ö²ÎÊý
printit 1;echo $1 | tr 'a-z' 'A-Z'

³ÌÐò14:until do done
[root@localhost scripts]# cat sh14.sh
until [ "$yn" = "yes" ] || [ "$yn" == "YES" ]
do
read -p "please input yes/to stop this program:" yn
done

³ÌÐò15£ºwhile do done
[root@localhost scripts]# cat sh15.sh
s=0
i=0
while [ "$i" != "100" ]
do
i=$(($i+1))
s=$(($s+$i))
done
echo "number of 1+2+3+...+100=$s"
³ÌÐò16£ºfor do done
[root@localhost scripts]# cat sh16.sh
s=0
for((i=1;i<=100;i=i+1))
do
s=$(($s+$i))
done
echo $s
exit 0

³ÌÐò17:for do done(2)
[root@localhost scripts]# cat sh17.sh
for animal in dog cat elephant
do
echo "there are ""$animal"
done
exit 0

³ÌÐò18£ºÀûÓà for do done²éÕÒijһ¸öĿ¼ÏÂÃæµÄÎļþȨÏÞÐÅÏ¢
[root@localhost scripts]# cat sh18.sh
read -p "input a directory:" dir
if [ "$dir" == "" ] || [ ! -d "$dir" ]; then
echo "The $dir is not exist in the system"
exit 1
fi
echo `ls $dir`
filelist=`ls $dir`
for filename in $filelist
do
perm="";
test -r "$dir/$filename" && perm="$perm readable"
test -w "$dir/$filename" && perm="$perm writable"
test -x "$dir/$filename" && perm="$perm execuatable"
echo "The file $dir/$filename's permission is $perm"
done


Ïà¹ØÎĵµ£º

Linux iptableÎĵµ

×ÜÀÀ
ÓÃiptables -ADC À´Ö¸¶¨Á´µÄ¹æ
Ôò
£¬-AÌí¼Ó -Dɾ³ý -C ÐÞ¸Ä
iptables - [RI] chain rule num rule-specification[option]
ÓÃiptables - RI ͨ¹ý¹æÔòµÄ˳ÐòÖ¸¶¨
iptables -D chain rule num[option]
ɾ³ýÖ¸¶¨¹æÔò
iptables -[LFZ] [chain][option]
ÓÃiptables -LFZ Á´Ãû [Ñ¡Ïî]
iptables -[NX] chain
ÓÃ -NX ......

LinuxÄÚºËÅäÖÃÎĵµ(make menuconfig)

Ò»¡¢ÒýÑÔ£º
    ±¾ÎĵµµÄÄÚÈݴ󲿷ÝÄÚÈݶ¼ÊÇ´ÓÍøÉÏÊÕ¼¯¶øÀ´£¬È»ºóÅäºÏһЩеĽØÍ¼£¨Äں˰汾£ºV2.4.19£©¡£ÔÚÿһÅäÖÃÏîºó»áÓÐÒ»¸öÑ¡ÔñÖ¸ÄϵIJ¿·Ý£¬ÓÃÀ´Ö¸µ¼´ó¼ÒÔõôÑù¸ù¾Ý×Ô¼ºµÄÇé¿öÀ´×öÏàÓ¦µÄÑ¡Ôñ£»»¹ÓÐÔÚÿһ¸ö´óÏîºÍÎĵµµÄ×îºó»áÓÐÒ»¸ö¾­Ñé̸£¬ËüÊÇһЩ¸ßÊÖÃÇÔÚÓ¦¶ÔÎÊÌâºÍ´¦ÀíÌØÓÐÓ²¼þʱµÄһЩ¾­Ñ飨Õâ¸ö»¹µ ......

Linux²Ù×÷ϵͳÖйØÓÚcrontabµÄÈÕÖ¾´æ·Å

ĬÈÏÇé¿öÏ£¬crontabÖÐÖ´ÐеÄÈÕ־дÔÚ/var/logÏ£¬È磺
¡¡¡¡#ls /var/log/cron*
¡¡¡¡/var/log/cron /var/log/cron.1 /var/log/cron.2 /var/log/cron.3 /var/log/cron.4
¡¡¡¡crontabµÄÈÕÖ¾£¬µ±crondÖ´ÐÐÈÎÎñʧ°Üʱ»á¸øÓû§·¢Ò»·âÓʼþ¡£Èç¹ûÔÚ·þÎñÆ÷ÉÏ·¢ÏÖÒ»¸öÈÎÎñûÓÐÕý³£Ö´ÐУ¬¶øcrond·¢ÓʼþҲʧ°Ü¡£Í¨¹ý¿´mailµÄÈÕÖ¾£¬¿ ......

(ת)LinuxϵÄCppUnit µÄHelloWorldÊÖ¼Ç

ת×Ô£ºhttp://blog.csdn.net/panyuequn/archive/2009/12/07/4958454.aspx
°æÈ¨ÉùÃ÷£º±¾ÎİæÈ¨ËùÊô Tx7do@ÉϺ£°ë¶¡£¬¿ÉÒÔËæÒâ¸´ÖÆ´«²¥£¬µ«ÊDZí°Ñ°æÈ¨¸øÈÓÀ²=¡£=
²Ù×÷ϵͳϵͳ£ºUbuntu6£¬g++
Èí¼þ°æ±¾£ºcppunit-1.10.2.tar.gz
£¨1£©»ñµÃÔ´Â룺
    µ½cppunit.sourceforge.netÉÏÏÂÔØÔ´´úÂë¡£½«Æä¸´ÖƵ½µ½l ......

linux±ÊÊÔÌâÄ¿


Ò»£®Ìî¿ÕÌâ
1. ÔÚLinuxϵͳÖУ¬ÒÔ     ·½Ê½·ÃÎÊÉ豸 ¡£
2. LinuxÄÚºËÒýµ¼Ê±£¬´ÓÎļþ     ÖжÁȡҪ¼ÓÔØµÄÎļþϵͳ¡£
3. LinuxÎļþϵͳÖÐÿ¸öÎļþÓà     À´±êʶ¡£
4. È«²¿´ÅÅÌ¿éÓÉËĸö²¿·Ö×é³É£¬·Ö±ðΪ               ¡£
5. Á´½Ó ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ