Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!ccu.umanitoba.ca!herald.usask.ca!alberta!ubc-cs!uw-beaver!milton!dali.cs.montana.edu!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!wuarchive!ukma!hsdndev!dartvax!news From: kriso@lombard.dartmouth.edu (Kris Olander) Newsgroups: comp.sys.hp Subject: ed(1) Bug with input redirection. hp/ux 7.0 Message-ID: <1991Feb19.214534.11861@dartvax.dartmouth.edu> Date: 19 Feb 91 21:45:34 GMT Sender: news@dartvax.dartmouth.edu (The News Manager) Followup-To: kris.olander@dartmouth.edu Organization: Dartmouth College, Hanover, NH Lines: 28 Originator: kriso@lombard.dartmouth.edu The following script snipit will fail to do what it's suppose to do -- ie: delete the first line of /tmp/file.x. ------------------------------------------------ ed /tmp/file.x << stop > /dev/null 1d w q stop ------------------------------------------------- If you don't redirect the output to /dev/null, you'll see two or three '?' which seems to indicate that ed(1) isn't happy with the input. This code was in a Makefile so it was running under sh, however, we verified that it doesn't matter whether this is done in sh or csh. We've worked around this by using sed(1) instead. -- Kris Olander --------------kris.olander@dartmouth.edu---------------- "My thought, my whole thoughts, and nothing but my thoughts, so help me God", -- My stdclaimer