[Ilugc] Help on Vi Editor
- From: sridharinfinity@xxxxxxxxx (Sridhar Ratna)
- Date: Tue Mar 15 08:13:17 2005
On the other hand, the input redirection makes it pointless to use
perl's in-place editing features. Ideally, I'd do:
perl -pi .bak -e '...' filename
getting the best of both worlds.
Why fiddle much with perl,sed,bash .... ? There is only way to do it.
Do it in python
$ cat infile | python -c "import sys; print
'\n'.join([x[:-1]+'@domain.com' for x in sys.stdin.readlines()])" >
outfile
:-)
--
Sridhar Ratna -
http://www.livejournal.com/users/seedar/
Other related posts: