Does it have to be sed specifically?  How about:

cat test.sed | awk '{print $2,$1}' > newfile

Mike

Michael K. Smith         NoaNet
206.219.7116 (work)      206.579.8360 (cell)
[EMAIL PROTECTED]       http://www.noanet.net



> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Kok Kok
> Sent: Tuesday, March 11, 2003 10:17 PM
> To: [EMAIL PROTECTED]
> Subject: sed to replace the words
> 
> 
> Hi all
> 
> I have question how to replace words using sed
> 
> ./script 61.100 192.168
> 
> The script is 
> #!/bin/sh
> sed -e 's/$2/$1/g' file > newfile
> 
> The problem is 192.168 can't replace 61.100 in the
> newfile
> 
> Please help
> 
> Thank you
> 
> 
> 
> 
> ______________________________________________________________
> ________ 
> Post your free ad now! http://personals.yahoo.ca
> 
> To Unsubscribe: send mail to [EMAIL PROTECTED]
> with "unsubscribe freebsd-questions" in the body of the message
> 


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message

Reply via email to