Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!rochester!cornell!uw-beaver!rice!sun-spots-request From: decwrl!sun!wrs!wrs.UUCP!roger@ucbvax.berkeley.edu (Roger Rohrbach) Newsgroups: comp.sys.sun Subject: -f doesn't work in SunOS version of sed Keywords: SunOS Message-ID: <3825@kalliope.rice.edu> Date: 9 Jun 89 21:42:34 GMT Sender: usenet@rice.edu Organization: Sun-Spots Lines: 53 Approved: Sun-Spots@rice.edu X-Sun-Spots-Digest: Volume 8, Issue 29, message 6 of 17 This is a warning to hapless users of sed(1). The "-f" option to sed does not behave in the same way in SunOS as it does in most other Unix implementations, to wit: if the file containing the script is empty, sed either mistakes its first input file name for a script, or produces no output, according as it is invoked with or without a filename parameter, respectively. This misbehavior is demonstrated below, where the output of the 4.3BSD and SunOS 4.0 versions of sed is compared: This bug affects, e.g., shell programs that build up temporary sed scripts, which may possibly be null, for use as filters. --- 4.3BSD sed -f output: % head /usr/dict/words > WORDS % sed -f /dev/null WORDS a AAA AAAS Aarhus Aaron ABA Ababa aback abacus abalone % cat WORDS | sed -f /dev/null a AAA AAAS Aarhus Aaron ABA Ababa aback abacus abalone % --- SunOS4.0 sed -f output: % sed -f /dev/null WORDS sed: Unrecognized command: WORDS % cat WORDS | sed -f /dev/null % -- Roger Rohrbach sun!wrs!roger roger@wrs.sun.com .- Eddie sez: ----------------------------------------------- (c) 1986, 1989 -. | {o >o | | \<>) "People call me rude. I wish we all were nude." |