Manish Uskaikar wrote:
Hi,

I want to do a simple search replace on a unix command prompt. What i require is a 
syntax to do is?
echo "I am Manish"|<perl command>
output     I am Jeff.

Please help.

Regards
Manish U
------------------------------
The information contained in this message is confidential and proprietary to 
KnowledgeWorks Global Limited, Mumbai, India. It is intended only for the use of the 
individual or entity to whom it is addressed. If you are not the intended recipient, 
or the authorized agent thereof, you are hereby notified that any disclosure, use, 
distribution, dissemination or copying in any form of any information contained in 
this message is strictly prohibited. If you have received this message by mistake or 
error, please notify us immediately by return email to the sender or by fax on number 
+91-22-28291673 and delete all copies of the original message.

Phone : 91-22-56971177 Ext 323



There must be a better way but what comes to my mind is

echo "I am Manish" | perl -e 'while(<>){ s/Manish/Jeff/g ; print "$_"}'



BTW why would you want to do it in perl
A much faster alternative will be
echo "I am Manish" | sed 's;Manish;Jeff'


Bye Ram





--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to