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

linux shell script Àý×Ó1

1. ÈçºÎ»ñµÃ½Å±¾²ÎÊý£º
#!/bin/she
#
while [ -n "$1" ]
do
case "$1" in
-a) echo "found the -a option";;
-b) param="$2"
echo "found the -b option";;
-c) echo "found the -c option";;
--) shift
break;;
*) echo "$1 is not an option";;
esac
shift
done
count=1
for para in "#@"
do
echo "parameter #$count : $para"
count=$[ $count + 1 ]
done
2.ÅжÏÊäÈëÊÇ·ñ·ûºÏÌõ¼þ£º
 #!/bin/sh
#
read input
if [[ $input == r* && ${#input} -eq 10 ]]; then #check the input character bits
echo "yes, your input right."
else
echo "no ,your input error."
fi
3.ÈçºÎÈÃÓû§ÊäÈ룬Èç¹ûÄãÏëµÃµ½Óû§ÊäÈëÒ»¶¨Òª¼ÇµÃread command.
 #!/bin/sh
#
#
read -n1 -t 10 -p "Do you want to continue [Y/N]?" answer
case $answer in
Y | y) echo
echo "fine, continue on ... ";;
N | n) echo
echo "ok, goodbye
exit;;
esac
echo "this is the end of the script"
 4.´ÓÎļþÖжÁ³öÊý¾Ý
#!/bin/sh
#
#
#
count=1
cat testfile | while read line
do
echo "Line $count : $line"
count=$[ $count + 1 ]
done
echo "finished processing the file"
#you can also use the read command to read data stored in a file on the linux system. each call to the read command reads a single line of text from the file. when there are no more lines left in the file,the read command will exit with a non-zero exit status.
5.´´½¨×Ô¼ºµÄÖض¨ÏòÎļþÃèÊö·û
#!/bin/bash
# storing STDOUT, then coming back to it
exec 3>&1
exec 1>test14out
echo "This should store in the output file"
echo "along with this line."
exec 1>&3
echo "Now things should be back to normal"
#This example is a little crazy, so let’s walk through it piece by piece. First, the script redirects file descriptor 3 to the current location of file descriptor 1, which is STDOUT. This means that any output sent to file descriptor 3 will go to the monitor.The second exec command redirects STDOUT to a file. The shell will now redirect any output se


Ïà¹ØÎĵµ£º

ʵս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²Ã¼ô

×î½ü¹«Ë¾Òª×ölinuxǶÈëʽϵͳ£¬Ä¿Ç°Ö÷°åÊDzÉÓÃx86½á¹¹¡£ËùÒÔ¾ÍÔÚ×Ô¼ºµÄ±¾±¾ÉÏ×°ÁËÒ»¸öÐéÄâµÄºìÆì6¡£
ÒòΪÊÇÐÂÊÖ£¬¸Õ¿ªÊ¼µÄʱºòÈÏΪlinux²Ã¼ôÄѵÄÓ¦¸ÃÊÇϵͳÄں˲üô£¬¿ÉÊÇÒ»¶Îʱ¼ä·¢ÏÖ²»Êǵġ£Ïà±ÈÖ®ÏÂÄÚºËÊDZȽϼòµ¥µÄ¡£
Äں˲üôÖ÷ÒªµÄ¹¤×÷ÊÇÄãÐèҪʲô¹¦ÄܾͰѶÔÓ¦µÄÄ£¿éÑ¡ÉÏ£¬ÄѵãÖ»ÊÇÓ¢Óï²»ÈÝÒ׿´¶®£¬Òªµ½ÍøÉÏËÑË÷·­ ......

LinuxÐéÄâÄÚ´æ»ù´¡ÖªÊ¶

1.´Ó80386¿ªÊ¼£¬Intel´¦ÀíÆ÷µÄÏßÐÔ32±»·ÖΪ3¸öÓò£¬×î¸ßʮλΪ´ËÏßÐÔµØÖ·ÔÚҳĿ¼µÄË÷Òý£»ÖмäʮλΪ´ËÏßÐÔµØÖ·ÔÚÒ³±íÖеÄË÷Òý£»×îµÍ12ΪÎïÀíµØÖ·µÄµÍ12루Ҳ¿ÉÒÔ˵ÊÇÒ³ÄÚÆ«ÒÆÁ¿£©¡£Ã¿¸ö½ø³ÌÒ»¶¨Óи÷×Ô¶ÀÁ¢µÄÒ³±í£¨×¢Ò⣺ÕâÀï˵µÄÊǽø³Ì£¬¶ø²»ÊÇÏ̡߳£ÔÚlinuxÀïÏß³ÌÆäʵ¾ÍÊÇÇáÁ¿¼¶µÄ½ø³Ì£¬ËûÃÇÊÇÁ¬Ò³Ä¿Â¼¶¼ÏàͬµÄ½ø³Ì£¬Ö»ÊÇ ......

linux ÕýÔò±í´ïʽѧϰ2

ÕýÔò±í´ïʽ(regular expression)
[code:1]ÕýÔò±í´ïʽ(regular expression)
--------------------------------------------------------------------------------
¹Ø¼ü×Ö£º ÕýÔò±í´ïʽ£¬Regular Expression
Ô­Öø£ºÐ¦ÈÝ
´´×÷ÓÚ£º2004Äê05ÔÂ03ÈÕ
×îºó¸üУº2004Äê05ÔÂ04ÈÕ 21:12
°æȨÉùÃ÷£ºÊ¹Óô´×÷¹«ÓðæÈ¨Ð­Ò ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ