Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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·¢Ðа汾½éÉÜ

1.Ubuntu
ËüµÄÒâ˼ÿһλGeekÓ¦¸Ã¶¼ÖªµÀ£¬ÕâÊÇÒ»¸ö¹Å·ÇÖÞÓïµ¥´Ê£¬´ú±í“ÈËÐÔ”»òÕß“ÎҵĴæÔÚÊÇÒòΪ´ó¼ÒµÄ´æÔÚ”¡£
2.PCLinuxOS
PC + Linux + Operating System£¬Óû§½çÃæºÜÏñWindows¡£
3.openSUSE
ÊÇNovellºÍAMD×ÊÖúµÄSUSEÉçÇøÏîÄ¿£¬SUSEÈ¡µÂÓïµ¥´ÊÊ××Öĸ“Software- und System-Entwicklun ......

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

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

perlÔÚlinuxÖÐÕÒ²»µ½½âÊÍÆ÷µÄÎÊÌâ

×î½ü¸Ð½Ó´¥perl£¬¸Ð¾õºÜ²»´í£¬´¦ÀíÎı¾·Ç³£·½±ã¡£Ç°½×¶ÎÓÃcȥͳ¼ÆһЩÎı¾£¬ÀÛµÄÒªËÀ£¬¶øÇÒ³ÌÐòÖл¹¾­³£³öbug£»¶øÓÃperlÔò²»Í¬£¬Ëü±ÜÃâµÄ¸´ÔÓµÄÊý¾Ý½á¹¹£¬ÕâÑù³ö´íµÄ¸ÅÂʾͺÜСÁË£¬¶øÇÒ±àд´úÂë¶ÌС¾«º·¡£Ç°Á½Ì콫perlÄõ½linuxÉÏÔËÐУ¬ËäÈ»Ìí¼ÓÁË#!/usr/local/bin/perl£¬µ«»¹ÊÇÌáʾÕÒ²»µ½½âÊÍÆ÷£ºbad interpreter¡£ÓôÃÆѽ¡ ......

Mr. ProcessµÄÒ»Éú£­LinuxÄں˵ÄÉç»áÊÓ½Ç (2)Æô¶¯

ÆäʵÕâ²ÅÓ¦¸ÃÊÇÕâһϵÁÐÎÄÕµĵÚÒ»½Ú£¬ÒòΪÕâƪÎÄÕ½²µÄÊÇÅ̹ſªÌìµØµÄÊ¡£»°ËµMr.
ProcessÊÇÒ»¸öÏÖ´úÈË£¬µ«ÊÇ£¬Ö»ÒªÊÇÈË£¬×ܸÃÓиö×æÏÈ¡£ÈËÃÇ×ÜÏëÖªµÀ×Ô¼º´ÓÄÄÀ´£¬È»ºó²Å¿ÉÒÔ¹ÀÃþËãÒ»ÏÂ×Ô¼º½«È¥ÏòºÎ·½¡£ËùÒÔÔÛÒ²ÒªÁ˽âÒ»ÏÂ
LinuxµÄÊÀ½çÀïÈËÀàµÄÆðÔ´¡£
ͼ1£º´ÓÉϵ絽BIOS
°´ÏµçÔ´¿ª¹ØµÄÄǸöÕæʵµÄÈ˾ÍÊÇLinuxÊÀ½çÀïµÄ ......

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ºÅ