#!/bin/bash err_fn() { echo '$1' passed to the function is $1 echo '$2' passed to the function is $2 exit 1 } echo '$1' from the command line is $1 echo '$2' from the command line is $2 read stop if [ $# -ne 2 ] then err_fn " you are wrong " "I am the second dollar" else echo you entered 2 args so we\'ll go on fi