Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!ames!oliveb!pyramid!prls!philabs!micomvax!musocs!mcgill-vision!mouse From: mouse@mcgill-vision.UUCP Newsgroups: comp.unix.questions Subject: Re: Why does this shell program run under csh???? Message-ID: <800@mcgill-vision.UUCP> Date: Sun, 7-Jun-87 04:40:07 EDT Article-I.D.: mcgill-v.800 Posted: Sun Jun 7 04:40:07 1987 Date-Received: Sat, 13-Jun-87 11:26:52 EDT References: <243@kosman.UUCP> Organization: McGill University, Montreal Lines: 30 In article <243@kosman.UUCP>, kevin@kosman.UUCP (Kevin O'Gorman) writes: > I am running Ultrix 1.2A (a Berkely type thing) and have written two > shell programs [which] are almost identical, the exceptions being one > argument to dump(8) and some commentary. [...] a read command [] > works in one (daily) and fails in the other (monthly), with a message > something like > read: not found > which makes me think that daily runs under /bin/sh (which has 'read' > builtin), and that monthly runs under /bin/csh (which gives the exact > same error message). "some commentary" - are you aware of the #! convention? If a shell script's first two bytes (ie, the first two bytes of the first line) are #! then the rest of the line is taken to indicate what shell is to be used to run the script. For example, if one says #! /bin/sh and the other says #! /bin/csh then that explains it. Failing that, check out how they are run. Is one run via "sh .../daily" and the other via "csh .../monthly" or something? der Mouse (mouse@mcgill-vision.uucp)