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

linuxÃüÁîÖ®awk


Table of Contents
1. awk¼ò½é
2. awkÃüÁî¸ñʽºÍÑ¡Ïî
2.1. awkµÄÓï·¨ÓÐÁ½ÖÖÐÎʽ
2.2. ÃüÁîÑ¡Ïî
3. ģʽºÍ²Ù×÷
3.1. ģʽ
3.2. ²Ù×÷
4. awkµÄ»·¾³±äÁ¿
5. awkÔËËã·û
6. ¼Ç¼ºÍÓò
6.1. ¼Ç¼
6.2. Óò
6.3. Óò·Ö¸ô·û
7. gawkרÓÃÕýÔò±í´ïʽԪ×Ö·û
8. POSIX×Ö·û¼¯
9. Æ¥Åä²Ù×÷·û(~)
10. ±È½Ï±í´ïʽ
11. ·¶Î§Ä£°å
12. Ò»¸öÑéÖ¤passwdÎļþÓÐЧÐÔµÄÀý×Ó
13. ¼¸¸öʵÀý
14. awk±à³Ì
14.1. ±äÁ¿
14.2. BEGINÄ£¿é
14.3. ENDÄ£¿é
14.4. Öض¨ÏòºÍ¹ÜµÀ
14.5. Ìõ¼þÓï¾ä
14.6. Ñ­»·
14.7. Êý×é
14.8. awkµÄÄÚ½¨º¯Êý
15. How-to
1. awk¼ò½é
awk ÊÇÒ»ÖÖ±à³ÌÓïÑÔ£¬ÓÃÓÚÔÚlinux/unix϶ÔÎı¾ºÍÊý¾Ý½øÐд¦Àí¡£Êý¾Ý¿ÉÒÔÀ´×Ô±ê×¼ÊäÈë¡¢Ò»¸ö»ò¶à¸öÎļþ£¬»òÆäËüÃüÁîµÄÊä³ö¡£ËüÖ§³ÖÓû§×Ô¶¨Ò庯ÊýºÍ¶¯Ì¬ÕýÔò±í´ïʽµÈÏȽø¹¦ÄÜ£¬ÊÇ linux/unixϵÄÒ»¸öÇ¿´ó±à³Ì¹¤¾ß¡£ËüÔÚÃüÁîÐÐÖÐʹÓ㬵«¸ü¶àÊÇ×÷Ϊ½Å±¾À´Ê¹Óá£awkµÄ´¦ÀíÎı¾ºÍÊý¾ÝµÄ·½Ê½ÊÇÕâÑùµÄ£¬ËüÖðÐÐɨÃèÎļþ£¬´ÓµÚÒ»Ðе½×îºóÒ»ÐУ¬Ñ°ÕÒÆ¥ÅäµÄÌض¨Ä£Ê½µÄÐУ¬²¢ÔÚÕâЩÐÐÉϽøÐÐÄãÏëÒªµÄ²Ù×÷¡£Èç¹ûûÓÐÖ¸¶¨´¦Àí¶¯×÷£¬Ôò°ÑÆ¥ÅäµÄÐÐÏÔʾµ½±ê×¼Êä³ö (ÆÁÄ»)£¬Èç¹ûûÓÐÖ¸¶¨Ä£Ê½£¬ÔòËùÓб»²Ù×÷ËùÖ¸¶¨µÄÐж¼±»´¦Àí¡£awk·Ö±ð´ú±íÆä×÷ÕßÐÕÊϵĵÚÒ»¸ö×Öĸ¡£ÒòΪËüµÄ×÷ÕßÊÇÈý¸öÈË£¬·Ö±ðÊÇAlfred Aho¡¢Brian Kernighan¡¢Peter Weinberger¡£gawkÊÇawkµÄGNU°æ±¾£¬ËüÌṩÁËBellʵÑéÊÒºÍGNUµÄһЩÀ©Õ¹¡£ÏÂÃæ½éÉܵÄawkÊÇÒÔGUNµÄgawkΪÀýµÄ£¬ÔÚ linuxϵͳÖÐÒÑ°ÑawkÁ´½Óµ½gawk£¬ËùÒÔÏÂÃæÈ«²¿ÒÔawk½øÐнéÉÜ¡£
2. awkÃüÁî¸ñʽºÍÑ¡Ïî
2.1. awkµÄÓï·¨ÓÐÁ½ÖÖÐÎʽ
*
awk [options] ’script’ var=value file(s)
*
awk [options] -f scriptfile var=value file(s)
2.2. ÃüÁîÑ¡Ïî
-F fs or –field-separator fs
Ö¸¶¨ÊäÈëÎļþÕÛ·Ö¸ô·û£¬fsÊÇÒ»¸ö×Ö·û´®»òÕßÊÇÒ»¸öÕýÔò±í´ïʽ£¬Èç-F:¡£
-v var=value or –asign var=value
¸³ÖµÒ»¸öÓû§¶¨Òå±äÁ¿¡£
-f scripfile or –file scriptfile
´Ó½Å±¾ÎļþÖжÁÈ¡awkÃüÁî¡£
-mf nnn and -mr nnn
¶ÔnnnÖµÉèÖÃÄÚÔÚÏÞÖÆ£¬-mfÑ¡ÏîÏÞÖÆ·ÖÅä¸ønnnµÄ×î´ó¿éÊýÄ¿£»-mrÑ¡ÏîÏÞÖƼǼµÄ×î´óÊýÄ¿¡£ÕâÁ½¸ö¹¦ÄÜÊÇBellʵÑéÊÒ°æawkµÄÀ©Õ¹¹¦ÄÜ£¬ÔÚ±ê×¼awkÖв»ÊÊÓá£
-W compact or –compat, -W traditional or –traditional
ÔÚ¼æÈÝģʽÏÂÔËÐÐawk¡£ËùÒÔgawkµÄÐÐΪºÍ±ê×¼µÄawkÍêÈ«Ò»Ñù£¬ËùÓеÄawkÀ©Õ¹¶¼±»ºöÂÔ¡£
-W copyleft or –copyleft, -


Ïà¹ØÎĵµ£º

ÔÚlinuxÏÂʵÏÖweb qqµÄ×ÀÃ滯


´´½¨×ÀÃæͼ±ê
Ä¿Ç°½«ÍøÂçÓ¦ÓÃÀ©Õ¹µ½×ÀÃæÊÇÒ»¸öÇ÷ÊÆ£¬´æÔÚןܶà½â¾ö·½°¸£¬±¾ÎÄÒÔ Mozilla Prism ΪÀý£¬ÀàËƵķ½·¨Í¬ÑùÊÊÓÃÓÚ Google Chrome ¡£
1. µ½ Mozilla Prism µÄÍøÕ¾ÉÏÏÂÔØ Prism£¬µã»÷ Download Now Ö®ºó»áÌáʾÓÐÁ½ÖÖ£¬Ò»ÖÖÊÇÒÔ Mozilla Firefox À©Õ¹µÄ·½Ê½£¬ÊʺÏÒѾ­°²×°ÓÐ Firefox µÄÅóÓÑ£»Ò»Ö ......

Linux PCIÇý¶¯µÄ±àд

PCIÊÇÍâΧÉ豸»¥ÁªµÄ¼ò³Æ(Peripheral Component
Interconnect)µÄ¼ò³Æ£¬×÷ΪһÖÖͨÓõÄ×ÜÏß½Ó¿Ú±ê×¼£¬ËûÔÚ¼ÆËã»úϵͳÖеõ½Á˹㷺µÄʹÓá£PCIµÄËÙ¶ÈÄܹ»´ïµ½132M/s¡£ÔÚÕâÀï¼òµ¥µÄ½é
ÉÜһϠlinux ÏÂPCIÇý¶¯µÄʵÏÖ¡£
ÔÚ±àдһ¸öPCIÇý¶¯µÄʱºòÎÒÃÇÏȵÃÈ·¶¨ÏµÍ³ÖÐÊÇ·ñÓÐÎÒÃǵÄÉ豸¡£ÎÒÃÇ¿ÉÒÔͨ¹ýlspci
²é¿´PCIÉ豸¡£
[roo ......

LinuxÏà¹ØÃüÁһ£©

linuxÃüÁî´óÈ« cat cd
chmod chown
cp cut
Ãû³Æ£ºcat
ʹÓÃȨÏÞ£ºËùÓÐʹÓÃÕß
ʹÓ÷½Ê½£ºcat [-AbeEnstTuv] [--help] [--version] fileName
˵Ã÷£º°Ñµµ°¸´®Á¬½Óºó´«µ½»ù±¾Êä³ö£¨Ó©Ä»»ò¼Ó > fileName µ½ÁíÒ»¸öµµ°¸£©
²ÎÊý£º
-n »ò --number ÓÉ 1 ¿ªÊ¼¶ÔËùÓÐÊä³öµÄÐÐÊý±àºÅ
-b »ò --number-nonblank ºÍ -n ......

Linux϶àÏß³Ì(pthread)±à³ÌʵÀý

LinuxϵͳϵĶàÏß³Ì×ñÑ­POSIXÏ߳̽ӿڣ¬³ÆΪ pthread¡£±àдLinuxϵĶàÏ̳߳ÌÐò£¬ÐèҪʹÓÃÍ·Îļþpthread.h£¬Á¬½ÓʱÐèҪʹÓÿâlibpthread.a¡£Ë³±ã˵һÏ£¬Linux ÏÂpthreadµÄʵÏÖÊÇͨ¹ýϵͳµ÷ÓÃclone£¨£©À´ÊµÏֵġ£clone£¨£©ÊÇ LinuxËùÌØÓеÄϵͳµ÷Óã¬ËüµÄʹÓ÷½Ê½ÀàËÆfork£¬¹ØÓÚclone£¨£©µÄÏêϸÇé¿ö£¬ÓÐÐËȤµÄ¶ÁÕß¿ÉÒÔÈ¥²é ......

linux I2CÇý¶¯·ÖÎö

I2CÊÇPhillips¿ª·¢µÄ2ÏߵĴ®ÐÐ×ÜÏßЭÒ顣ͨ³£Ó¦ÓÃÔÚǶÈëʽϵͳÖÐÈò»Í¬µÄ×é¼þͨÐÅ£¬PCÖ÷°å¿ÉÒÔͨ¹ýI2CÀ´Ó벻ͬµÄ´«¸ÐÆ÷ͨÐÅ¡£ÕâЩ´«¸ÐÆ÷ͨ³£±¨¸æ·çÉÈËٶȣ¬´¦ÀíÆ÷ζȺÍÕû¸öÓ²¼þϵͳµÄÐÅÏ¢£¬Õâ¸öЭÒéÒ²¿ÉÒÔÓÃÔÚRAM chipsÉÏ£¬Ïò²Ù×÷ϵͳÌṩDIMMµÄÐÅÏ¢¡£
ÔÚ2.0ʱI2CµÄkernelÔ´Âë²»ÔÚÄÚºËÀïµÄ£¬2.4Äں˰üÀ¨ÁËÒ»µã¶ÔI2CµÄÖ§³Ö ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ