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

linux shell ×Ö·û´®½ØÈ¡×ܽá

linuxÖжÔ×Ö·û´®µÄ´¦Àí£º
1.×Ö·û´®·Ö¸îÀýÈç  AAAAA-BBBBBB  °´-·Ö¸îȥǰºóÁ½²¿·Ö
 cut £º
[rich@localhost ~]$ str=AAAAA-BBBBBB
[rich@localhost ~]$ echo $str | cut -d "-" -f 1
AAAAA
[rich@localhost ~]$ echo $str | cut -d "-" -f 2
BBBBBB
½âÊÍ£ºA £ü B  ½«AÃüÁîµÄÊä³ö ×÷ΪBÃüÁîµÄÊäÈë
cut
-d  £º·Ö¸ô·û
-f   £º field  ·Ö¸îºóµÄÊý×éË÷Òý Ö»²»¹ýÊÇ´Ó1¿ªÊ¼
Èç¹û²»´æÔÚ·Ö¸î·ûÔò·µ»ØÈ«²¿£º
[rich@localhost ~]$ echo $str | cut -d "c" -f 1
AAAAA-BBBBBB
expr  £¦£¦ cut£º
È¡“-”µÄË÷Òý
[rich@localhost ~]$ index=`expr index  "${str}" "-"`
[rich@localhost ~]$ echo $str | cut -c`expr "${index}" + 1`-
BBBBBB
[rich@localhost ~]$ echo $str | cut -c1-`expr ${index} - 1`
AAAAA
cut
-c ½ØÈ¡×Ö·û´® Ë÷Òý´Ó1¿ªÊ¼
-cA-   Aµ½Ä©Î²
-cA  AλÖÃ
-c A-B   Ë÷ÒýA-B
-c-A   ½ØÈ¡Ç°A¸ö×Ö·û
substr£º
[rich@localhost ~]$ index=`expr ${index} - 1`
[rich@localhost ~]$ echo `expr substr "${str}" 1 ${index}`
AAAAA
substr  str A  B
´ÓË÷ÒýA¿ªÊ¼½ØÈ¡B³¤¶ÈµÄ×Ö·û´®


Ïà¹ØÎĵµ£º

LinuxÄÚ´æÄ£ÐÍ

LinuxÄÚ´æÄ£ÐÍ
 
Àí½â Linux ʹÓõÄÄÚ´æÄ£ÐÍÊÇ´Ó¸ü´ó³Ì¶ÈÉÏÕÆÎÕ Linux Éè¼ÆºÍʵÏֵĵÚÒ»²½£¬Òò´Ë±¾ÎĽ«¸ÅÊö Linux ÄÚ´æÄ£Ðͺ͹ÜÀí¡£
ÓëÄÚ´æ¹ÜÀíÓйصÄÖ÷ÒªÎÊÌâÓУº
l  ÐéÄâÄÚ´æµÄ¹ÜÀí£¬ÕâÊǽéÓÚÓ¦ÓóÌÐòÇëÇóÓëÎïÀíÄÚ´æÖ®¼äµÄÒ»¸öÂß¼­²ã¡£
l  ÎïÀíÄÚ´æµÄ¹ÜÀí¡£
l  ÄÚºËÐéÄâÄÚ´æµÄ¹ÜÀí/ÄÚºËÄÚ´ ......

awk&grep ÃüÁîÍêÈ«½âÎö Ö®linux¸ß¼¶ÃüÁî

awk ÍêÈ«½âÎö
awk´¦ÀíµÄ¹¤×÷ÓëÊý¾Ý¿âµÄ´¦Àí·½Ê½ÓÐÏà֮ͬ´¦£¬ÆäÏàͬ´¦Ö®Ò»¾ÍÊÇawkÖ§³Ö¶Ô¼Ç¼ºÍ×ֶεĴ¦Àí¡£
ÓòºÍ¼Ç¼
awkÖ´ÐÐʱ£¬Æää¯ÀÀÓòÓÃ$1¡¢$2¡¢…¡¢$n±êʶ£¬¶à¸öÓòÖ®¼äÓöººÅ·Ö¸ô£¬Èç$1,$3¡£
$0±êʶÕû¸ö¼Ç¼(ÕûÐÐ)¡£
 
1 ÏÔʾÎı¾ÎļþmyfileÖеÚÆßÐе½µÚÊ®ÎåÐÐÖÐÒÔ×Ö·û%·Ö¸ôµÄµÚÒ»×ֶΣ¬µÚÈý×ֶκ͵ÚÆ ......

ÈçºÎÔÚlinux/unixÖÐÉèÖÃÏ̵߳ÄÓÅÏȼ¶

ÈçºÎÔÚlinux/unixÖÐÉèÖÃÏ̵߳ÄÓÅÏȼ¶
int pthread_create(pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine)(void*), void *arg);
À´´´½¨Ị̈߳¬µ«ÊÇÈçºÎÉèÖÃÏ̵߳ÄÓÅÏȼ¶ÄØ£¿
ÔÚÌÖÂÛÕâ¸öÎÊÌâµÄʱºò£¬ÎÒÃÇÏÈҪȷ¶¨µ±Ç°Ïß³ÌʹÓõĵ÷¶È²ßÂÔ£¬posixÌṩÁË
int pthread_attr_getschedpolicy(const pth ......

Linux bootloader ±àд·½·¨

¼¶±ð£º ³õ¼¶
·¶Ïþ¾æ (xiaoju_f@263.net), ÁªÏë(±±¾©)ÓÐÏÞ¹«Ë¾Èí¼þÉè¼ÆÖÐÐÄǶÈëʽÑз¢´¦¿ª·¢¹¤³Ìʦ, ÁªÏë(±±¾©)ÓÐÏÞ¹«Ë¾Èí¼þÉè¼ÆÖÐÐÄ
2003 Äê 8 ÔÂ 11 ÈÕ
¶ÔÓÚÒÆÖ² linux µ½ÆäËü¿ª·¢°åµÄÈËÀ´Ëµ£¬±àд boot loader ÊÇÒ»¸ö²»¿É±ÜÃâµÄ¹ý³Ì¡£¶ÔÓÚѧϰlinuxµÄÈËÀ´½²£¬±àд bootloader Ò²ÊÇÒ»¸öºÜÓÐÌôÕ½ÐԵŤ×÷¡£±¾ÎÄͨ¹ý¶Ô li ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ