Originally Posted by gilead
Is that from O'Reilly's "Learning the bash shell"? $0 doesn't change because the function executes in the environment of the shell script and $0 takes the name of the script.
It's actually O'Reilly's 'Learning the Korn Shell'. I'm working on bash though, adapting stuff on the way.
Somehow the $1 and $2 accept the function's(with in the script) arguments. According to the book $0 would change too to the name of the function it's being called from.
Appreciate the help.