bash Control Structures

News

bash

Recommended  Links

    Advanced navigation
if statements Loops in Shell case select Sequences Pipes in Loops 
Arithmetic expressions Comparison operators BASH Debugging Shell history   Etc

BASH supports the typical for other shells set of high level flow control constructs. Most of them were introduced by Born Shell:

Be warned: the syntax is not pretty.

One of the big improvements that modern versions of bash have when compared with the original Bourne shell is in the area of arithmetic. Bash re-implemented major advances of ksh93 and now have ((...)) constructs. Paradoxically early versions of the Unix shell had no built-in arithmetic; it had to be done by invoking a separate executable (expr), even just to add 1 to a variable.

All conditional statements in shell depends on the expressions and due to the age of the shell (Borne shell it's more then 30 years old) there are many historical layers with different capabilities.

Recommended Links

Please visit  Heiner Steven SHELLdorado  the best shell scripting site on the Internet

Advanced Bash-Scripting Guide

 



Copyright © 1996-2007 by Dr. Nikolai Bezroukov. www.softpanorama.org was created as a service to the UN Sustainable Development Networking Programme (SDNP) in the author free time. Submit comments This document is an industrial compilation designed and created exclusively for educational use and is placed under the copyright of the Open Content License(OPL). Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.

Standard disclaimer: The statements, views and opinions presented on this web page are those of the author and are not endorsed by, nor do they necessarily reflect, the opinions of the author present and former employers, SDNP or any other organization the author may be associated with. We do not warrant the correctness of the information provided or its fitness for any purpose.

Last modified: April 04, 2008