leestretton.com

You are in: > Home > Developers Guides

Shell Scripting - Invoking Shell Scripts

There are two ways to invoke a shell script file, 'Direct interpretation' and 'Indirect interpretation':

In direct interpretation, the command

bash filename [arg ...]

invokes the program csh to interpret the script contained in the file `filename'.

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

#!/bin/bash

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. The script can then be invoked in the same way as any other command, i.e., by typing the script file name on the command line.

Problem with this page? Let us know
© Lee Stretton 2005 | powered by linux powered by php 5 powered by MySQL download rss feeds powered by php 5 valid css