Tuesday, November 02, 2004

Shell procedures

Shell procedures

From Steve Parker

The shell may be used to read and execute commands contained in a file. For example,
	sh file [ args ... ]

calls the shell to read commands from file. Such a file is called a command procedure or shell procedure. Arguments may be supplied with the call and are referred to in file using the positional parameters $1, $2, .... For example, if the file wg contains
	who | grep $1

then
	sh wg fred

is equivalent to
	who | grep fred

0 Comments:

Post a Comment

<< Home