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

Linux Bash Shellѧϰ£¨Ê®ËÄ£©£ºÃüÁîÐÐÑ¡Ïî


¡¡¡¡±¾ÎÄÒ²¼´¡¶Learning the bash Shell¡·3rd EditionµÄµÚÁùÕÂCommand-Line Options and Typed varilablesÖ®¶ÁÊé±Ê¼ÇÖ®Ò»£¬µ«ÎÒÃǽ«²»ÏÞÓÚ´Ë¡£
¡¡¡¡ÔÚLinuxÃüÁîÖо­³£´øÓвÎÊýÀýÈç[-option]µÈµÈ¡£ÔÚÃüÁîÐÐÖпÉÄÜÓÐ0¸ö»òÕß¶à¸öÕâЩѡÏî¡£ÎÒÃÇÔÚ֮ǰѧϰÁËλÖòÎÊý£¬°üÀ¨$1£¬$2£¬$3…£¬$*£¬$#£¬²Î¼ûLinux Bash Shellѧϰ£¨Æß£©£ºshell±à³Ì»ù´¡——ÔËÐÐShell½Å±¾¡¢function
¡£ÕâЩλÖòÎÊý¶¼ÊÇÖ»¶Á¡£
ÒÆÎ»Shift
¡¡¡¡shiftÌṩ¶ÔÖ»¶ÁµÄλÖòÎÊýµÄÒÆÎ»¸³ÖµµÄ²Ù×÷£¬½«1=$2£¬2=$3£¬…£¬¿ÉÒÔʹÓÃshift NÀ´Öƶ¨ÒÆÎ»µÄÊýÄ¿£¬ÀýÈçshift 3£¬Ôò±íʾ1=$4£¬2=$5£¬…¡£Èç¹ûÃüÁîÐÐÖÐÓÐ[-options]µÄ£¬ÎÒÃÇ¿ÉÒÔ¶ÔËûÃǽøÐÐÅжϣ¬²¢½øÐÐÒÆÎ»´¦Àí¡£Ò»¸ö¼òµ¥Àý×ÓÈçÏ£º
if [ $1 = -o ]; then

   
[process the -o option] 

    shift

fi

[normal processing of arguments...]
¡¡¡¡ÏÂÃæ¸øÁ½¸öÀý×Ó£¬½éÉÜÈçºÎÓÃshiftÀ´¼ì²é²ÎÊý¡£
#Àý×ÓÒ»£ºÓпÉÄÜÓÐ-NµÄ²ÎÊý£¬ÇÒΪµÚÒ»²ÎÊý¡£Èç¹ûµÚÒ»¸ö²ÎÊýÊÇ-N£¬¼Ç¼ÔÚhowmanyÖУ¬½øÐÐshift£¬½«$2ÖÃÓÚ$1µÄλÖã¬Èç¹ûµÚÒ»¸ö²ÎÊýÊÇ-X£¬µ«X²»ÊÇÊý×Ö£¬¸ø³ö¾¯¸æÓï¾ä£¬·ñÔòhowmanyʹÓÃȱʡµÄ-10¡£


function test1

{

    #¶ÔÓÚgrep£¬^±íʾ´ÓÆ¥ÅäÐÐÊ×£¬$±íʾƥÅäÐÐ⣬ÔÚÕâÀï±íʾÕû¸ö$1Æ¥Å䣬¶ø²»ÊDz¿·ÖÆ¥Å䣬*±íÊ¾Ç°ÃæµÄ×Ö·ûÆ¥Åä0¸ö»òÕß¶à¸ö£¬ÏÂÃæ[0-9]*¼´±íʾºóÃæ¸ú×Å0¸ö»òÕß¶à¸öÊý×Ö£¬[0-9][0-9]*±íʾÊý×ÖºóÃæÓÐ0¸ö»ò¶à¸öÊý×Ö¡£¹Êecho $1 | grep '^-[0-9][0-9]*$'±íʾƥÅä¸ñʽ-N£¬NΪÊý×Ö¡£grepµÄ¾ßÌåÓ÷¨¿´²Î¼ûhttp://www.yesadmin.com/301/135287/index.html
 
    #$(command)±íʾÃüÁîÖ´ÐеÄÄÚÈÝ¡£

    #-n str£¬×Ö·û´®²»Îªnull£¬³¤¶È´óÓÚÁã

    #Çë×¢ÒâË«ÒýºÅµÄʹÓ㬱íʾÕâÊÇÒ»¸öÐèÒª¼ì²éµÄstr
   
    if [ -n "$(echo $1 | grep '^-[0-9][0-9]*$')"
]; then

        howmany=$1

       shift

    elif [ -n "$(echo $1 | grep '^-')" ]; then

  &nbs


Ïà¹ØÎĵµ£º

ʵսLinux Bluetooth±à³Ì£¨ËÄ£© L2CAP²ã±à³Ì

£¨L2CAPЭÒé¼ò½é£¬L2CAPÔÚBlueZÖеÄʵÏÖÒÔ¼°L2CAP±à³Ì½Ó¿Ú£©
Ò»£ºL2CAPЭÒé¼ò½é£º
Logical Link Control and Adaptation Protocol(L2CAP)
Âß¼­Á¬½Ó¿ØÖƺÍÊÊÅäЭÒé (L2CAP) ΪÉϲãЭÒéÌá¹©ÃæÏòÁ¬½ÓºÍÎÞÁ¬½ÓµÄÊý¾Ý·þÎñ£¬²¢Ìṩ¶àЭÒ鹦ÄܺͷָîÖØ×é²Ù×÷¡£L2CAP ³äÐíÉϲãЭÒéºÍÓ¦ÓÃÈí¼þ´«ÊäºÍ½ÓÊÕ×î´ó³¤¶ÈΪ 64K µÄ L2CAP Ê ......

ʵսLinux Bluetooth±à³Ì(Áù) L2CAP±à³ÌʵÀý

ÀýÒ»£º·¢ËÍSignaling Packet£º
Signaling CommandÊÇ2¸öBluetoothʵÌåÖ®¼äµÄL2CAP²ãÃüÁî´«Êä¡£ËùÒÔµÃSignaling CommandʹÓÃCID 0x0001.
¶à¸öCommand¿ÉÒÔÔÚÒ»¸öC-frame£¨control frame£©Öз¢ËÍ¡£
 Èç¹ûÒªÖ±½Ó·¢ËÍSignaling Command.ÐèÒª½¨Á¢SOCK_RAWÀàÐ͵ÄL2CAPÁ¬½ÓSocket¡£ÕâÑù²ÅÓлú»á×Ô¼ºÌî³äCommand Code£¬Identi ......

linux software

³ÌÐòÊÇÓÃÓÚÖ´ÐÐÌØ¶¨ÈÎÎñµÄ¼ÆËã»úÖ¸Áî×éºÏ¡£³ÌÐò¿ÉÒÔÓûã±àÓïÑÔ£¬Ò»Öַdz£µÍ¼¶µÄ¼ÆËã»úÓïÑÔÀ´±àд£¬Ò²¿ÉÒÔʹÓúͻúÆ÷Î޹صĸ߼¶ÓïÑÔ£¬±ÈÈç C
ÓïÑÔ±àд¡£²Ù×÷ϵͳÊÇÒ»¸öÌØÊâµÄ³ÌÐò£¬ÔÊÐíÓû§Í¨¹ýËüÔËÐÐÓ¦ÓóÌÐò£¬±ÈÈçµç×Ó±íºÍÎÄ×Ö´¦ÀíµÈµÈ¡£±¾Õ½éÉÜÁË»ù±¾µÄ±à³ÌÔ­Àí£¬²¢¼ò½é²Ù×÷ϵͳµÄÄ¿µÄºÍ¹¦ÄÜ¡£
2.1 Computer Languages ......

LINUXѧϰ֮Âà ViµÄѧϰ

Vi¾ÍÏ൱windowsÉÏÃæµÄ¼Çʱ¾£¬Äã˵²»Ñ§ÐÐÂ𣿲»Ðеģ¬ÌرðÊÇÔÚserver»·¾³ÏÂÃæ£¬²»ÓÃÄǶ«Î÷ÎҾͲ»ÖªµÀÔõôÑùÈ¥ÅäÖÃÄÇ´ó¶ÑµÄÅäÖÃÎļþ£¬Èç¹ûviÓõĺõϰ£¬Äã¿ÉÒÔÔÚÅäÖ÷½Ãæ½ÚÊ¡ºÜ´óµÄÁ¦Æø£¬µ«ÊÇǰÌáÊǵû¨µãʱ¼ä°ÑËûѧºÃ£¬ÎÒÖ»ÖªµÀ×î»ù±¾µÄ²Ù×÷vi£¬µ«ÊÇÓõĺܲ»ºÃ£¬ÎÒ¼ûÒ»¸çÃÇÓÃÄǶ«Î÷ÓõĿÉÌ«ÉñÁË£¬Óùý¶«¶«À´×÷³ÌÐò¿ª·¢£¬Î ......

[ת]Linux ÖÐ x86 µÄÄÚÁª»ã±à

Linux ÖÐ x86 µÄÄÚÁª»ã±à
¼¶±ð£º ³õ¼¶
Bharata B. Rao (rbharata@in.ibm.com)IBM Linux ¼¼ÊõÖÐÐÄ£¬IBM Èí¼þʵÑéÊÒ£¬Ó¡¶È
2001 Äê 3 ÔÂ 01 ÈÕ
Bharata B. Rao ÌṩÁËÔÚ Linux ƽ̨ÉÏʹÓú͹¹Ôì x86 ÄÚÁª»ã±àµÄ¸ÅÀ¨ÐÔ½éÉÜ¡£Ëû½éÉÜÁËÄÚÁª»ã±à¼°Æä¸÷ÖÖÓ÷¨µÄ»ù´¡ÖªÊ¶£¬ÌṩÁËһЩ»ù±¾µÄÄÚÁª»ã±à±àÂëÖ¸µ¼£¬²¢½âÊÍÁËÔÚ Linux ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ