Looking for quick way of editing a text file
Dave Mitchell
davem at iabyn.com
Mon Nov 21 00:19:24 UTC 2005
On Mon, Nov 21, 2005 at 11:06:02AM +1100, Cameron Simpson wrote:
> Bsed is a wrapper for sed. It takes pretty well the same arguments as sed,
> but edits files in place. I frequently use it for batch edits; it's very
> handy. Example:
>
> bsed '4s/that/that/' filename.txt
>
> Replace "this" with "that" on line 4. It essentially does all the redirection
> of the first sed with error handling, temp files and such.
Note that perl can do a similar edit-in-place, eg
perl -ipe 's/this/that/' *.txt
--
O Unicef Clearasil!
Gibberish and Drivel!
- "Bored of the Rings"
More information about the fedora-list
mailing list