Flow Control

Tux

This is post 12 of 19 in the series “[ Shell Scripting ]” The Bourne/bash shell supports a variety of conditionals, loops and other flow control operations. You’ll use these often. if The if statement is a simple conditional. Its syntax is: if condition ; then commands [elif condition ; then commands]… [else commands] fi …

Pipes

Glenn Norman

This is post 10 of 19 in the series “[ Shell Scripting ]” Any number of commands can be pipelined together. command1 | command2 The above command creates a pipe: the standard output of command1 is connected to the standard input of command2. Any command that can accept Standard Input and produce Standard Output is …

IO Redirection

Hacker Girl

This is post 9 of 19 in the series “[ Shell Scripting ]” By default, every process has three associated file descriptors: standard input (0), standard output (1) and standard error (2). For these, Your keyboard is the default source of standard input. Your monitor is the default target for standard output, and Your monitor …