[comp.unix.shell] signature of the Bourne shell and the C shell

xwang@gmuvax2.gmu.edu (Xiang-Min Wang) (02/24/91)

I am writing a shell script in which I want, among other things, to have
the capability of testing first the system is the Bourne shell or the C
shell. Right now, I am using some system shell variables to do that. I
do not feel comfortable with this solution. I want to know you (the
netter) have any rebust solution to this problem (test is it the Bourne
or C shell?). Any suggestions or ideas welcome. Thank you in advance.

Please send your response to:

	xwang@gmuvax2.gmu.edu (usa)
	xwang@gmuvax.bitnet (usa)

xwang

luj@gus16.ecn.purdue.edu (Jun Lu) (02/25/91)

In article <3596@gmuvax2.gmu.edu> xwang@gmuvax2.gmu.edu (Xiang-Min Wang) writes:
>I am writing a shell script in which I want, among other things, to have
>the capability of testing first the system is the Bourne shell or the C
>shell. Right now, I am using some system shell variables to do that. 

Why do you want to know that ? You can take the _control_ by telling the
system which shell you want it to use to interprete your shell script.
You can start your shell script with its first line being someting
like this:

#! /bin/<your_favortie_shell>

For more info, see execve(2)

BTW, both sh and csh are "essential utilities" and come with almost with
every "standard" unix.  If you miss either one, call your vendor.

--
-- Jun Lu                          Internet:luj@ecn.purdue.edu          --
-- Aeronautics & Astronautics      Bitnet:  luj%ecn.purdue.edu@purccvm  --
-- Purdue University               UUCP:    pur-ee!luj                  -- 
-- W. Lafayette, IN 47907          Phone:317-494-9410  Fax:317-494-0307 --