cat <<EOF >test.sh func() { echo '$0'=$0 '$1'=$1 } func a b EOF ----------------------------- ironman@inbu-ironman:/tmp$ . test.sh $0=/bin/bash $1=a ironman@inbu-ironman:/tmp$ ./test.sh $0=./test.sh $1=a