Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!tektronix!tekgen!puffin!penguin!richl From: richl@penguin.USS.TEK.COM (Rick Lindsley) Newsgroups: comp.unix.questions Subject: Re: Problem with rcp/rsh/rdump Message-ID: <95@puffin.USS.TEK.COM> Date: Fri, 9-Oct-87 19:22:03 EDT Article-I.D.: puffin.95 Posted: Fri Oct 9 19:22:03 1987 Date-Received: Mon, 12-Oct-87 02:42:43 EDT References: <441@nysernic> <759@gargoyle.UChicago.EDU> <2696@xanth.UUCP> Sender: nobody@puffin.USS.TEK.COM Reply-To: richl@penguin.USS.TEK.COM (Rick Lindsley) Organization: Tektronix, Inc., Beaverton, OR. Lines: 42 Keywords: Where are you? In <759@gargoyle.UChicago.EDU>, chris@gargoyle.UChicago.EDU writes: > # > # Check to see if this is an interactive shell... > if ($?prompt) then > ... > endif In article <2696@xanth.UUCP> kyle@xanth.UUCP (Kyle Jones) adds: > An oft missed optimization of this is > > if ($?prompt == 0) exit 0 > > which allows csh to skip parsing the rest of the file. This may not be such a good idea. Remember the shell is sourcing this file; telling it to exit may not be what you want at all. Let me present a worst case scenario. I was having trouble figuring out why a shell script was not working correctly: while true do stuff done "Stuff" was never getting done. Turns out a combination of two things were happening. The user's .cshrc had a line in that said if ($?prompt == 0) exit 1 and /bin/true was -- # # id string here # exit 0 -- Use your wizardry to see the bug here. Rick