[SunHELP] grepping lines

Jeff Howie sunhelp at sunhelp.org
Sun Feb 25 13:54:20 CST 2001


Mike Meredith wrote:
> On Sun, 25 Feb 2001, you wrote:
> > I have to deal with that a lot, too ("you didn't reply to my email
> > properly, you're supposed to start at the top...". uuuurrr!).
> 
> Most of the time I'm too lazy to mention it, but at least I stick my
> own replies in the proper place --- so the whole message is
> comprehensible.
> 
> > > > >echo "2,10p\nq\n" | ed -s file
> >
> > Anyway. I tried your line on our Solaris 8 box under ksh, and it
> > works just like you said it would.
> 
> I think I may have figured out the problem; if you're using a shell
> without echo builtin, and you have /usr/ucb in your path before /bin
> (or anywhere else echo might be), you'll end up with an echo that won't
> expand the '\n'.

That makes sense. It's a real pain to have to worry about whether echo supports
the escape chars or not (\n,\t, etc.). When scripting under ksh (which is my
main shell), I stick to using the 'print' builtin instead of echo. Then I know.

-- 
THKS :&)
Jeff Howie



More information about the SunHELP mailing list