#!/bin/bash err_fn() { echo here is my error function echo $1 echo and $2 } echo please enter a 1 or a 2 read number #note that the function has 2 arguments PASSED to it #those arguments are totally seperate from the command line #arguments even though it has the same familiar name '$1 and $2' as #the command line arguments if [ $number -eq 1 ] then err_fn "You entered a 1" "this is the second err_fn argument" else err_fn "you entered a 2" "$1" fi echo the argument '$1' that you entered at the command line is $1 echo it is totally seperate from the argument '$1' echo that you passed to the function