sed script to add >'s to quoted text

Peter da Silva peter at ficc.ferranti.com
Wed Feb 27 04:58:34 AEST 1991


In article <Feb.23.10.31.33.1991.12538 at pilot.njin.net> dblack at pilot.njin.net (David Alan Black) writes:
> pilot% cat > quote
> sed s/^/\>/ -e $1 > $1.quoted
> ^D

It's a different kind of quoting altogether. The bourne shell considers ^ as
an alias for | so you need to quote the first argument to sed:

sed 's/^/>/' $1 > $1.quoted

I would recommend quoting commands and regular expressions regardless.

(in addition, the "-e" option means the following argument is a command:
 leave it out or put it before the command)
-- 
Peter da Silva.  `-_-'  peter at ferranti.com
+1 713 274 5180.  'U`  "Have you hugged your wolf today?"



More information about the Comp.unix.shell mailing list