Judas1012
September 4th, 2004, 05:06 PM
I'm using sed to process a text file for an assignment in my class and am a bit stuck. We're taking UNIX man pages, converting them to ascii via sed, then converting the ascii files into tex files for use with latex and xdvi.
I'm down to the last part and am a bit confused on the exact syntax that we must use in order to find a line in a text file whose first nonblank character is - or + in this case and then append some text (a space and \\) to the end of that line.
My expression is this:
s/^[\-\+]/& \\\\/
...and I have no idea why it doesn't work. Can anyone help?
I have also tried:
s/^[\-\+]./& \\\\/
...and that doesn't seem to work either.
I'm down to the last part and am a bit confused on the exact syntax that we must use in order to find a line in a text file whose first nonblank character is - or + in this case and then append some text (a space and \\) to the end of that line.
My expression is this:
s/^[\-\+]/& \\\\/
...and I have no idea why it doesn't work. Can anyone help?
I have also tried:
s/^[\-\+]./& \\\\/
...and that doesn't seem to work either.