sh and csh scripts (SCO ODT 1.0 with SCO Unix 3.2.1)

Kannan Konath konath at sj.ate.slb.com
Thu Jan 24 09:57:48 AEST 1991


I have a few shell scripts that are either csh (C shell) or sh (Bourne
shell) scripts.  However the facility of specifying the type of script,
that is available in the Berkeley/SunOS environement (ie. #!/bin/csh or
#!/bin/sh), does not seem to work in SCO ODT (SCO Unix).

I have two questions:

a) Is this the way System V R3 executes scripts or is it a bug in 
   SCO Unix?  Is  "#!/bin/<shell_name>" in a shell script 
   understood   by SysVR3.

b) Is there any way for me to run these scripts automatically without
    having to resort to "csh <csh_script>" or "sh <sh_script>" and
    given that my default shell could be either one of the shells,
    ie., csh or sh.

   One clumsy method that I did think of using was to have two files.
   Assume the shell script is to be called SHELLscr, then have two
   files SHELLscr and one of SHELLscr.csh or SHELLscr.sh.  The file SHELLscr
   just contains one line "csh SHELLscr.csh" or "sh SHELLscr.sh" 
   depending on the type of shell script.  I haven't tried this but
   it should work.
   
  

kannan

konath at sj.ate.slb.com



More information about the Comp.unix.sysv386 mailing list