Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Using sed to add characters
Name: Anukta C. Date: September 19, 2002 at 06:43:52 Pacific OS: HP-UX CPU/Ram: 130
Comment:
Hi, I have to add the characters "//#" to the beginning of each line in a file. My shell is the Korn shell. I am trying to do sed s/^///#/ abc > a But this did not work. So i tried sed s/^/\/\/#/ abc > a But this did not work either. I even tried enclosing it with double-quotes. Any ideas how to do this? -Anukta
Summary: Howdy Nails, That almost worked. It did rejoin the lines. But It's two character offset now. I'll review the reference you provided and run from there. So after reading that, ( Great reference )modi...
Summary: Hi. I would like to be able to update only one line in a file that matches a key using sed, but I can't seem to get this (the key is right at the beginning of each row) Here is what I have tried so fa...
Summary: How to use sed to extract the text I have a text file look like this: /home1/users/usr1/bill.txt /home1/users/usr2/bom.txt /tmp/cost.txt All filename extension ended with txt. I need to output the a...