[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: 字符串查找替换的命令?



sed -i 是在当前文件内操作,不新增加文件。

在 2011年12月24日 上午9:27,Plain_Text <resation@gmail.com> 写道:
>
>
> 2011-12-23(Friday) 16:58:27 -0800, CHEN Xing <cxcxcxcx@gmail.com>:
>
>> 不懂正好可以借机看一下~ sed一般就可以:
>>  sed -i 's/FROM/TO/g' filename.txt
>
>
>   多谢这位大洋彼岸的大哥!并非我懒,其实我查过 man 的,而且试着使用
> sed 's/FROM/TO/' filename.txt >> NewFile.txt 去实现。但发现它只能对每
> 行替换一次,原来是少了个 "g".
>
>
>
> --
> To UNSUBSCRIBE, email to debian-chinese-gb-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> Archive: http://lists.debian.org/20111224012725.GC2654@localhost.localdomain
>

Reply to: