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, -
Ïà¹ØÎĵµ£º
1.Ubuntu
ËüµÄÒâ˼ÿһλGeekÓ¦¸Ã¶¼ÖªµÀ£¬ÕâÊÇÒ»¸ö¹Å·ÇÖÞÓïµ¥´Ê£¬´ú±í“ÈËÐÔ”»òÕß“ÎҵĴæÔÚÊÇÒòΪ´ó¼ÒµÄ´æÔÚ”¡£
2.PCLinuxOS
PC + Linux + Operating System£¬Óû§½çÃæºÜÏñWindows¡£
3.openSUSE
ÊÇNovellºÍAMD×ÊÖúµÄSUSEÉçÇøÏîÄ¿£¬SUSEÈ¡µÂÓïµ¥´ÊÊ××Öĸ“Software- und System-Entwicklun ......
ÔÚǶÈëʽƽ̨ÉÏÔËÐÐQTEʱ£¬Ê¹ÓõļüÅÌͨ³£²»ÊDZê×¼¼üÅÌ£¬¶øÊÇǶÈëʽÉ豸ÍâÀ©µÄÆÕͨ°´¼ü¡£ÄÇôʵÏÖQTE¼üÅÌÊäÈëµÄ·½
·¨´óÌåÉÏ¿ÉÒÔ·ÖΪÁ½Àࣺ
£¨1£©±àдһ¸öÆÕͨ°´¼üÇý¶¯£¬È»ºó¿ª±ÙÒ»¸öQTÏ̶߳ÁÈ¡°´¼üÖµ£¬ÔÚͨ¹ýÐźŰѰ´¼üÖµ·¢Ëͳö
È¥¡£ÐèÒª½ÓÊÕ¼üÅÌÊäÈëµÄÄ¿±ê£¬ÉùÃ÷²Ûº¯Êý£¬½ÓÊÕ¼üÅÌÐźš£
& ......
linux UART´®¿ÚÇý¶¯¿ª·¢Îĵµ
ʱ¼ä:2010-01-09 14:24:55À´Ô´:ÍøÂç ×÷Õß:δ֪ µã»÷:482´Î
ÄÚÈݼò½é: ½éÉÜÁËLinuxϵĴ®¿ÚÇý¶¯µÄÉè¼Æ²ã´Î¼°½Ó¿Ú, ²¢Ö¸³ö´®¿ÚÓëTTYÖÕ¶ËÖ®¼äµÄ¹ØÁª²ã´Î(´®¿Ú¿É×÷TTYÖÕ¶ËʹÓÃ), ÒÔ¼°LinuxϵÄÖжϴ¦Àí»úÖÆ/ÖжϹ²Ïí»úÖÆ, »¹Óд®¿Ú»º³å»úÖƵ±ÖÐÉæ¼°µÄÈíÖжϻúÖÆ; ÆäÖ ......
Ê×ÏȽéÉÜÏÂpthread_cond_t¡£ ÔÚLinuxϳÆ֮Ϊ״̬±äÁ¿£¬ÓëÖ®Ïà¹ØµÄÓÐÏÂÃ漸¸öAPI:
int pthread_cond_init (pthread_cond_t *COND,pthread_condattr_t *cond_ATTR);
int pthread_cond_signal (pthread_cond_t *COND);
int pthread_cond_broadcast (pthread_con ......