Shell½Å±¾ÖÐ$0¡¢$?¡¢$!µÈµÄÒâÒå
±äÁ¿ËµÃ÷
$$
Shell±¾ÉíµÄPID£¨ProcessID£©
$!
Shell×îºóÔËÐеĺǫ́ProcessµÄPID
$?
×îºóÔËÐеÄÃüÁîµÄ½áÊø´úÂ루·µ»ØÖµ£©
$-
ʹÓÃSetÃüÁîÉ趨µÄFlagÒ»ÀÀ
$*
ËùÓвÎÊýÁÐ±í¡£È硱$*¡±Óḡ±¡¹À¨ÆðÀ´µÄÇé¿ö¡¢ÒÔ¡±$1 $2 ¡ $n¡±µÄÐÎʽÊä³öËùÓвÎÊý¡£
$@
ËùÓвÎÊýÁÐ±í¡£È硱$@¡±Óḡ±¡¹À¨ÆðÀ´µÄÇé¿ö¡¢ÒÔ¡±$1¡å ¡°$2¡å ¡ ¡°$n¡± µÄÐÎʽÊä³öËùÓвÎÊý¡£
$#
Ìí¼Óµ½ShellµÄ²ÎÊý¸öÊý
$0
Shell±¾ÉíµÄÎļþÃû
$1¡«$n
Ìí¼Óµ½ShellµÄ¸÷²ÎÊýÖµ¡£$1ÊǵÚ1²ÎÊý¡¢$2ÊǵÚ2²ÎÊý¡¡£
½Å±¾¾ÙÀý
ÎÒÃÇÏÈдһ¸ö¼òµ¥µÄ½Å±¾£¬Ö´ÐÐÒÔºóÔÙ½âÊ͸÷¸ö±äÁ¿µÄÒâÒå
# touch variable
# vi variable
½Å±¾ÄÚÈÝÈçÏ£º
#!/bin/sh
echo ¡°number:$#¡±
echo ¡°scname:$0¡å
echo ¡°first :$1¡å
echo ¡°second:$2¡å
echo ¡°argume:$@¡±
±£´æÍ˳ö
¸³Óè½Å±¾Ö´ÐÐȨÏÞ
# chmod +x variable
Ö´Ðнű¾
# ./variable aa bb
number:2
scname:./variable
first: aa
second:bb
argume:aa bb
½á¹û·ÖÎö
ͨ¹ýÏÔʾ½á¹û¿ÉÒÔ¿´µ½£º
$# ÊÇ´«¸ø½Å±¾µÄ²ÎÊý¸öÊý
$0 Êǽű¾±¾ÉíµÄÃû×Ö
$1ÊÇ´«µÝ¸ø¸Ãshell½Å±¾µÄµÚÒ»¸ö²ÎÊý
$2ÊÇ´«µÝ¸ø¸Ãshell½Å±¾µÄµÚ¶þ¸ö²ÎÊý
$@ ÊÇ´«¸ø½Å±¾µÄËùÓвÎÊýµÄÁбí
ÍƼöÐÅÏ¢
- linuxÃüÁîѧϰ±Ê¼Ç£¨11£©£ºnlÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨5£©£ºrmÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨4£©£ºmkdirÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨1£©£ºlsÃüÁî
- ½«CentosµÄyumÔ´¸ü»»Îª¹úÄڵİ¢ÀïÔÆÔ´
- ʹÓÃNginxÌí¼Óheader·ÀÖ¹ÍøÒ³±»frame
- linuxϼÓËÙscp´«Êä´óÎļþµÄËÙ¶È
- linuxϵͳÉ϶ÔnginxÈÕÖ¾·Ö¸î´¦Àí
- lnmp/nginxϵͳÕæÕýÓÐЧµÄͼƬ·ÀµÁÁ´ÍêÕûÉèÖÃÏê½â
- Í»ÆÆÊ®Íò²¢·¢µÄNginxµÄÅäÖü°ÓÅ»¯
ÈÈÃÅÐÅÏ¢
- nohup: redirecting stderr to stdou....
- ʹÓÃlog_formatΪNginx·þÎñÆ÷ÉèÖøüÏêϸµÄÈÕÖ¾¸ñʽ
- jquery easyUI--dataGrid-Json
- [Ô´´]·ÂGoogle Reader¡¢ÐÂÀË΢²©¡¢ÌÚѶ΢²©µ....
- ÀûÓÃKeepalived+mysql¹¹½¨¸ß¿ÉÓÃMySQLË«Ö÷×Ô¶....
- Nginx+keepalivedʵÏÖ¸ºÔؾùºâºÍË«»úÈȱ¸¸ß¿ÉÓÃ
- jqueryʵÏÖÒ³Ãæ¼ÓÔؽø¶ÈÌõ
- Rolling cURL: PHP²¢·¢×î¼Ñʵ¼ù
- codeigniter ·ÓÉÖÕ¼«ÓÅ»¯(url rewrite)
- linuxÏÂÉèÖÃsshÎÞÃÜÂëµÇ¼
×î½ü¸üÐÂ
- ²éÕÒ²¢É¾³ý.svnĿ¼Îļþ
- redis ÆßÖÖÊý¾ÝÀàÐ͵ÄʹÓó¡¾°
- linux ÏÂÎļþ¸´ÖƵ½windowsÏÂÂÒÂëµÄ½â¾ö°ì·¨
- nginx³öÏÖ502 upstream sent too big he....
- linuxÏÂsudoÅäÖÃÏê½â
- linuxÃüÁîѧϰ±Ê¼Ç£¨15£©£ºtailÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨14£©£ºheadÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨13£©£ºlessÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨12£©£ºmoreÃüÁî
- ¼ÓÃÜËã·¨±È½Ï3DES AES RSA ECC MD5 SHA1µÈ
ÆÀÂÛ