Tag Archives: shell scripting

Top 10 Bash Programming Guides, Reference & Tools

Bash is a Unix/Linux  command interpreter (shell). Bash is the Bourne Again SHell created as part of  GNU Project.  Bash is an Bourne  shell compatible shell that incorporates useful features from the Korn shell (ksh) and C shell (csh). It offers functional improvements over Bourne shell  for both programming and interactive use. In addition, most Bourne shell scripts can be run by Bash without modification. Bash  is intended to conform to the IEEE POSIX P1003.2/ISO 9945.2 Shell and Tools standard.

Bash was originally written by Brian Fox of the Free Software Foundation. The current developer and maintainer is Chet Ramey of Case Western Reserve University.

The improvements offered by Bash include:

  • Command line editing
  • Unlimited size command history
  • Job Control
  • Shell Functions and Aliases
  • Indexed arrays of unlimited size
  • Integer arithmetic in any base from two to sixty-four

Here are the top 10 Bash Programming Guides, Reference  & Tools

Bash Positional Parameters

Shell has several special positional parameters which can be referenced but can not be assigned. These are used to process command line arguments in a shell script, to get process status, exit status and options flag.

These positional parameters can be assigned to a variable and values can be used for further processing.

 $0 , $1 $2 $3 … parameters

These are special parameters and and has specific meaning according to the number.  These parameters are useful if you want to validate executing file name and do the processing based on the arguments.

$0 : Shell argument 0, It expands into bash script file name or bash shell.

$1 $2 $3 …   : Shell argument number : Used to get the specific argument from the script.

for example let’s create & execute the test script with some parameters :