weird sh(1) behaviour

Frans Meulenbroeks meulenbr at cstw01.UUCP
Mon Aug 1 21:43:58 AEST 1988


[I posted this before to comp.unix.questions but got no reply;
 hopefully some wizard can help me]

I noticed a peculiarity in sh which causes me a lot of trouble.
The commands:
sh file
and
sh <file
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 <file won't.
The same holds when sh is used in a pipe.

I've played with the options of sh, but to no avail.
Can somebody explain this behaviour to me, and tell me how I can 
communicate through popen with the (a) shell, without losing my error
messages.

B.t.w. The problem is at least present in SunOS 3.4 and Ultrix 2.0

Many thanks!

-- 
Frans Meulenbroeks
	Centre for Software Technology
	...!mcvax!philmds!prle!cst!meulenbr   or   ...!uunet!prlb2!cst!meulenbr
        or perhaps   meulenbr at cst.prl.philips.nl



More information about the Comp.unix.wizards mailing list