ºìÁªLinuxÃÅ»§
Linux°ïÖú

LinuxÖÐͨ¹ýÃüÁîÖ±½Óɾ³ýÎļþÖÐ×îºóÒ»ÐÐ

·¢²¼Ê±¼ä:2008-04-05 21:49:11À´Ô´:ºìÁª×÷Õß:joyrce
ºÎνSed(Stream EDitor):

SedԭΪUNIXϵͳÉϵķǽ»Ì¸Ê½ÎÄ×ֱ༭Æ÷(non-interactive stream editor)¡£µ±Sed¶ÁÈë´ý±à¼­Îļþ£¬»áÒÀ±à¼­ÃüÁîÀ´½øÐÐÎļþµÄ±à¼­¹¤×÷¡£

sed -i '$d' file

ÈçͬÆäËüUNIXµÄÖ¸ÁîÒ»°ã£¬SedÒàÊÇÓɱê×¼ÊäÈë(standard input)¶ÁÈëÓû±à¼­µÄÎļþ£¬¾­Sed´¦Àíºó£¬ÔÙÓɱê×¼Êä³ö(standard output)Ëͳö½á¹û¡£ÓÉÓÚSedÊDzÉÖðÐжÁÈëÎÄ×Ö£¬²¢ÒÀ¾ÝÃüÁîÀ´½øÐб༭£¬Òò´Ë¿ÉÊÓ×÷µµ°¸ÖеÄÎÄ×ÖÖðÐÐͨ¹ýSed±à¼­Æ÷¡£

ÓÉÓÚSed¿ÉÒÀʹÓÃÕßËùϵÄÃüÁî×Ô¶¯Íê³ÉÎļþ±à¼­¹¤×÷£¬Òò¶ø³ÉΪ¹ÜÏßʽ´¦Àí(pipe line)ÖÐÎļþ±à¼­µÄÖØÒª¹¤¾ß¡£
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 0 ÌõÆÀÂÛ