Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!ucsd!swrinde!zaphod.mps.ohio-state.edu!lavaca.uh.edu!menudo.uh.edu!sugar!ficc!peter From: peter@ficc.ferranti.com (Peter da Silva) Newsgroups: comp.unix.shell Subject: Re: sed script to add >'s to quoted text Keywords: sed shell Message-ID: <.VQ94+9@xds13.ferranti.com> Date: 26 Feb 91 17:58:34 GMT References: Reply-To: peter@ficc.ferranti.com (Peter da Silva) Distribution: usa Organization: Xenix Support, FICC Lines: 17 In article dblack@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@ferranti.com +1 713 274 5180. 'U` "Have you hugged your wolf today?"