Tag Archives: bash

bash for loop Explained with Examples

bash , bourne again shell, provides shell scripting features in Linux and Unix /Unix like environments. bash off lots of functions and commands  and bash for loop is one of the most popular used function for the data processing . Learn more about bash for loop basic construction  , how to process a range of  data, define increments, using command outputs as inputs to for loop and more.

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, Arguments

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

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

 $0 , $1 $2 $3 … bash Parameters

These are special parameters 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 : bash Shell argument 0, It expands into bash script file name or bash shell.

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

for example let’s create & execute the test script with some parameters and note the bash arguments supplied as parameters :