Invoking Shell Scripts

There are two ways to invoke a shell script file.

Direct Interpretation

In direct interpretation, the command

csh  filename  [arg  ...]

invokes the program csh to interpret the script contained in the file ‘filename’.
 

Indirect Interpretation

In indirect interpretation, we must insert as the first line of the file

#!  /bin/csh

or

#!  /bin/csh  -f

(there are situations in which this is not necessary, but it won’t hurt to have it), and the file must be made executable using chmod (see previous discussion). Then it can be invoked in the same way as any other command, i.e., by typing the script file name on the command line.

The -f option says that we want fast startup, which it will achieve by not reading or executing the commands in .cshrc Thus for example, we won’t have the ‘set’ values for shell variables or the aliases from that file, but if we don’t need them, this will be much faster (if we need a few of them, we can simply add them to the script file itself).

Have a Unix Problem
Unix Forum - Do you have a UNIX Question?

Unix Books :-
UNIX Programming, Certification, System Administration, Performance Tuning Reference Books

Return to : - Unix System Administration Hints and Tips

(c) www.gotothings.com All material on this site is Copyright.
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk.
All product names are trademarks of their respective companies.
The site www.gotothings.com is in no way affiliated with or endorsed by any company listed at this site.
Any unauthorised copying or mirroring is prohibited.