Path: utzoo!attcan!uunet!husc6!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!sm.unisys.com!sdcsmb!sea!eggert From: eggert@sm.unisys.com (Paul Eggert) Newsgroups: comp.bugs.4bsd Subject: Re: 'sed -e' dumps core Message-ID: Date: 5 Sep 88 17:42:08 GMT References: <352@quintus.UUCP> Reply-To: eggert@sm.unisys.com (Paul Eggert) Organization: Unisys Santa Monica Lines: 19 Richard A. O'Keefe writes that "sed -e" dumps core in older SunOS releases, but not on SunOS 4.0RRBeta2 on a 386i. This prompts me to dig out the following bug report for SunOS 4.0 on a Sun-3/60 (Sun bug ID 1012595): sed: "-e '' file" and "-f /dev/null file" treat the file name as a command When sed is given an empty script with the -e or -f flag, it gets confused and tries to grab the next argument as a command. The following script illustrates the problem. All three commands should do nothing, but only the first one works correctly. % sed '' /dev/null % sed -e '' /dev/null sed: Extra text at end of command: /dev/null % sed -f /dev/null /dev/null sed: Extra text at end of command: /dev/null This new bug does not exist under SunOS 3.5 on the same machine; 3.5 exhibited the old core dumping bug. So if you're fixing the "'sed -e' dumps core" bug, please check that you do not introduce this new bug, like Sun did.