next up previous contents
Next: The for command Up: Control Previous: The case command   Contents

The while command

Example

#!/bin/bash
while [ "$1" != "" ]
do
  echo $1
  shift
done
exit 0

This is another way to process all input arguments - but not a very good way - what if one of the input arguments really is a null string?



P.D. Gronbech (IT Staff) 2015-10-02