Saturday, July 19, 2008

Special character ; at bashprompt

; is used as a command separator and to terminate a case statement at bash

#!/bin/bash

# This script is to explain the usage of the ; as a special character in bash.
# Sijo George
#--------------------------START-------------------------------
echo "Hello world,"; echo "How are you?"; # Execute two commands in a line using a ; delimiter
case $1 in
[a-z] ) echo " The input is an alphabet " ;; # Terminator in the case option
[0-9] ) echo " The input is a number" ;;
* ) echo " The input is neither an alpabet or a number ";;
esac

No comments: