Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA
Path: utzoo!watmath!clyde!bonnie!akgua!sdcsvax!sdcrdcf!hplabs!hao!seismo!brl-tgr!tgr!US.JD%CU20B@COLUMBIA.ARPA
From: Jeff Damens 
Newsgroups: net.unix
Subject: Re: 2 shell questions before the new year
Message-ID: <6820@brl-tgr.ARPA>
Date: Fri, 28-Dec-84 18:48:52 EST
Article-I.D.: brl-tgr.6820
Posted: Fri Dec 28 18:48:52 1984
Date-Received: Sun, 30-Dec-84 01:58:20 EST
Sender: news@brl-tgr.ARPA
Organization: Ballistic Research Lab
Lines: 27


>   1. What is the difference between
>
>		   sh < file
>   and
>		   sh file

With the "sh file" form, standard input can still be redirected
(that is, standard input for any programs that are invoked by
the shell; obviously the shell takes its input from file); the
"sh < file" form doesn't allow input redirection.

>   2. Why begin a shell script with
>
>		   #!/bin/sh
>   or
>		   #!/bin/csh

This tells the C shell which shell is supposed to interpret the
shell script.  It's necessary because the syntax of shell
commands is different in the two shells; I think /bin/sh is used
by default.  However, if the script starts with a # and doesn't
have the !  construct, the C shell is used

Jeff Damens, Systems Integration Group, Columbia U.

-------