Path: utzoo!utgpu!attcan!uunet!mcvax!hp4nl!mhres!hd From: hd@mh_co2.mh.nl (Theo Hardendood) Newsgroups: comp.unix.wizards Subject: Re: weird sh(1) behaviour Message-ID: <2184@mhres.mh.nl> Date: 3 Aug 88 00:13:09 GMT References: <163@cstw01.UUCP> Sender: news@mhres.mh.nl Lines: 42 From article <163@cstw01.UUCP>, by meulenbr@cstw01.UUCP (Frans Meulenbroeks): > I noticed a peculiarity in sh which causes me a lot of trouble. > The commands: > sh file > and > sh are NOT equivalent. > If you do think so, create a file which contains the command > rm core > Try both versions in a dir without a file named core. > sh file will give you an error message "No such file...", while > sh The same holds when sh is used in a pipe. Not sh but rm does his job this way. If the standard input is not a terminal, then no diagnostics are produced. This is certainly NOT a bug and makes it possible, for example, to use rm in a crontab entry without extensive checking. The difference between 'sh file' and 'sh