Unix shell scripts is written by Norman Matloff. This Unix shell scripting document explains you how to invoke shell scripts, shell variables, shell command arguments, language constructs, escape characters and also there is an example which shows shell script for deleting files.
Introduction
Any collection of csh commands may be stored in a file, and csh can be invoked to execute the commands in that file. Such a file is known as a shell script file. The language used in that file is called shell script language. Like other programming languages it has variables and flow control statements (e.g. if-then-else, while, for, goto).
In Unix there are several shells that can be used, the C shell (csh and its extension, the T C shell tcsh), the Bourne Shell (sh and its extensions the Bourne Again Shell bash and the highly programmable Korn shell ksh ) being the more commonly used. Note that you can run any shell simply by typing its name. For example, if I am now running csh and wish to switch to ksh, I simply type ksh, and a Korn shell will start up for me. All my commands from that point on will be read and processed by the Korn shell (though when I eventually want to log off, exiting the Korn shell will still leave me in the C shell, so I will have to exit from it too).
Read More/Try It
Introduction
Any collection of csh commands may be stored in a file, and csh can be invoked to execute the commands in that file. Such a file is known as a shell script file. The language used in that file is called shell script language. Like other programming languages it has variables and flow control statements (e.g. if-then-else, while, for, goto).
In Unix there are several shells that can be used, the C shell (csh and its extension, the T C shell tcsh), the Bourne Shell (sh and its extensions the Bourne Again Shell bash and the highly programmable Korn shell ksh ) being the more commonly used. Note that you can run any shell simply by typing its name. For example, if I am now running csh and wish to switch to ksh, I simply type ksh, and a Korn shell will start up for me. All my commands from that point on will be read and processed by the Korn shell (though when I eventually want to log off, exiting the Korn shell will still leave me in the C shell, so I will have to exit from it too).
Read More/Try It