UnixTips.net

* use my tips at your own risk !!

* use my tips at your own risk !!

Categories

  • Other (3)
  • Scripting (10)
  • Unix (70)
  • Wordpress (2)

Powered by Genesis

Add basic options to script

#!/bin/bash

if [ $# -ne 1 ]
then
echo "Usage: $0 "
exit 0
fi

host=$1

If no hostname is specified output will be:

./1.myscript.bash 
Usage: ./1.myscript.bash