The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 04-20-2007
P_W P_W is offline
Registered User
 

Join Date: Apr 2007
Posts: 4
where is the problem in my sed command....

for example i have the file that contain several line..and i want to swap the first word and the second word than i store it into new file..

on the command i wrote:

Code:
sed -e "s/^\([^]*\)\([^]*\)/\2\1/g" file > swapfile
i think its already correct...
but i got the error

Code:
sed: -e expression #1, char 26:invalid reference \2 on 's' command's RHS
actually whats wrong with this? i am very exhausted...
Reply With Quote
Forum Sponsor