Unix Shell Programming

Command Separation & Grouping

Characters that separate commands

Operator precedence

Command Separation & Grouping

Examples

Variables

Variables contain values, set explicitly or by the system

Examples

Read-Only Shell Variables

Some variables may only be read by shell scripts


Control-Flow Commands

Conditionals

Conditionals test the value of a condition, i.e. the exit status of a command

String comparisions

File checking

Integer comparisions

if then

Syntax:

Example:

if then else

Syntax:

Example:

if then elif

Syntax:

Example:

for in

Syntax:

Example:

for

Syntax:

Example: