标签:student 输出 nan put dmi dev manager global smi
1 global flag
sed ‘s/xxx/xxx/‘ inputfile,如果没有带global flag g的话,匹配替换的只是inputfile中的每一行的第一个匹配项。如果带了g的话,才会全部都替换。\
例子:MBA_students.txt
102,Jason Smith,IT Manager
103,Raj Reddy,Sysadmin
104,Anand Ram,Developer
105,Jane Miller,Sales Manager
sed ‘s/a/A/‘ MBA_students.txt
输出:
102,JAson Smith,IT Manager
103,RAj Reddy,Sysadmin
104,AnAnd Ram,Developer
105,JAne Miller,Sales Manager
sed ‘s/a/A/‘ MBA_students.txt
输出:
102,JAson Smith,IT MAnAger
103,RAj Reddy,SysAdmin
104,AnAnd RAm,Developer
105,JAne Miller,SAles MAnAger
标签:student 输出 nan put dmi dev manager global smi
原文地址:http://www.cnblogs.com/hustdc/p/6340588.html