View Single Post
Old Aug 16th, 2007, 3:47 PM   #7
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
My shell responds with:
sed: command garbled: s/\(#\)\(/dev/sde1.*\)/\2/

You need to escape the / character... like this:

sed 's/\(#\)\(\/dev\/sde1.*\)/\2/' /etc/fstab
sed 's/\(#\)\(\/dev\/sdf1.*\)/\2/' /etc/fstab


The only difference is the sde vs sdf... regular expressions would allow you to process them with just one line. But if its a one time execution, save yourself the trouble.

You're welcome PoM... There is another one for Awk floating around somewhere.
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote