[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Sheflug] sed Help
On Wed, Aug 28, 2002 at 12:53:20AM +0100, Alex Hudson wrote:
> > $ perl -pe 's!^!/mnt/home/aland/!' oldfile.py > newfile.py
> Pah. Waste of a regex.
> perl -e'print"/mnt/home/aland/$_"foreach(<>);'<oldfile.py>newfile.py
> Much quicker :)
Well, if you're gonna be like *that*... :p
perl -ne 'print "/mnt/home/aland/$_"' oldfile.py > newfile.py
Or just:
perl -pe 'print "/mnt/home/aland/"' oldfile.py > newfile.py
I was trying to keep it sed-like for ease of understanding :p
Dave
--
"A man who has nothing in particular to recommend him discusses all sorts of
subjects at random as though he knew everything."
- Sei Shonagon, "The Pillow Book"
http://www.cpio.org/~grimoire | http://www.livejournal.com/~diffrentcolours
___________________________________________________________________
Sheffield Linux User's Group -
http://www.sheflug.co.uk/mailfaq.html
GNU the choice of a complete generation.