sed script to add >'s to quoted text

David Alan Black dblack at pilot.njin.net
Sun Feb 24 02:31:35 AEST 1991


I am trying to devise a simple shell script to add ">" to the beginning of
every line of a text file containing an article or letter which I wish to
quote in my response.

Can someone please explain why the following doesn't work (I'll reproduce
the whole session):

pilot% cat > quote
sed s/^/\>/ -e $1 > $1.quoted
^D
pilot% chmod a+x quote
pilot% quote friend.letter
quote: />/: not found
pilot% sed: Illegal or missing delimiter: s/


It then sits there NOT giving me the % prompt, until I hit return (if that
matters).

Used interactively, the sed formula above has worked.  I must be doing some-
thing wrong in converting it to script form.

Please advise -

Thanks in advance,

David Black
dblack at pilot.njin.net


                         "I was....now!"

                           Mrs. Emma Peel



More information about the Comp.unix.shell mailing list