|
Programming -
Bash
|
|
Tuesday, 07 July 2009 07:11 |
|
To begin with bash scripting, let me introduce you to bash scripting. Bash script file is a file which consists of a sequence of bash commands to be executed starting with an interpreter. It helps you to reduce the time by avoiding repetitive use of commands in the terminal. Instead you can type that sequence of commands in order to a scripting file and save. Procedure Open a new file. We must first specify the shell we are using. It should preceed with a #! called 'shebang'. It provides the path to to the interpreter.Usually we use '/bin/sh' for using the default shell. '/bin/sh is a pointer to our default shell'. Or we can specify the shell as '/bin/bash'. Then we start writing the series of commands to be executed. Any line preceeding with a '#' is considered as a comment. An example of a shell scripting file is given below.
|
|
Last Updated on Wednesday, 08 July 2009 07:08 |