in reply to Curious about a quirk with the special variable, $0
a) you can create scripts that do different things if named differently (either via linking or renaming the script file). Also I think the path is included so you know where the script is located
b) Since $0 and a few other variables are available in every script they are predeclared. Otherwise you would have to start every script with a long list of special variables
c) Yes, in numeric context a non-numeric value evaluates to 0. perl -e 'print "test"+0;' will print 0
|
|---|