Path: utzoo!utgpu!attcan!uunet!lll-winken!lll-tis!ames!oliveb!sun!gorodish!guy From: guy@gorodish.Sun.COM (Guy Harris) Newsgroups: comp.unix.wizards Subject: Re: weird sh(1) behaviour Message-ID: <62508@sun.uucp> Date: 2 Aug 88 21:10:10 GMT References: <163@cstw01.UUCP> Sender: news@sun.uucp Lines: 25 > I noticed a peculiarity in sh which causes me a lot of trouble. No, you've noticed a peculiarity in "rm" that causes you trouble. > 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. "sh file" causes the shell to run all commands in "file" with the shell's standard input as their standard input. So does "sh 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. See above for the explanation. As for getting this to work via "popen", you may be out of luck.