The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #5 (permalink)  
Old 05-14-2008
penchal_boddu penchal_boddu is offline
Registered User
 

Join Date: Apr 2008
Location: Bangalore
Posts: 120
Hi,

Try this,

sed '/^0/s/ / -/g' filename .


Hi,

Can anybody suggest me how to leave the last line in the substitution.
Requirement is to do substitution in all the lines except the last line.

I tried

sed '!$s/ / -/g' filename ....But its not working ..giving syntax error

Thanks
Penchal
Reply With Quote