On May 18, Lance Murray said:

perl -i -p -e "s/oldhostname/newhostname/g" /etc/hosts

However, what is the syntax if I wanted to just process a text stream to stdout?, e.g.:

cat /etc/hosts | perl "s/in_text/out_text/g"

Simple: use the -p and -e switches, but not the -i switch.

--
Jeff "japhy" Pinyan         %  How can we ever be the sold short or
RPI Acacia Brother #734     %  the cheated, we who for every service
http://japhy.perlmonk.org/  %  have long ago been overpaid?
http://www.perlmonks.org/   %    -- Meister Eckhart

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to