On 08:47 17 Dec 2002, Thierry ITTY <[EMAIL PROTECTED]> wrote:
| sed can't do edit-in-place, you'd better use perl with -i -p -e flags
|
| to change a file :
| perl -p -i -e 's/<USERNAME>/joe.somebody/' file
|
| to change a bunch of files :
| find /your/path -name 'pattern' -exec perl -p -i -e
| 's/<USERNAME>/joe.somebody/' {} \;
Yes and no. I have reasons to loathe and despise perl's -i mode
(it uses unlink/rename, which mangles ownership and perms).
So I use bsed:
http://www.zip.com.au/~cs/scripts/bsed
which is a wrapper for sed that does in-place edit, thus:
bsed 's/<USERNAME>/joe.somebody/g' file1 file2 file3...
Fetch it and use. It's extremely useful, to me anyway.
--
Cameron Simpson, DoD#743 [EMAIL PROTECTED] http://www.zip.com.au/~cs/
Microsoft - where "cross platform" means "runs in both Win95 and WinNT".
- Andy Newman <[EMAIL PROTECTED]>
--
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list