argv[0] manipulation

Donn Cave donn at u.washington.edu
Wed Dec 11 13:07:07 EST 2002


Quoth P_spam_ at draigBrady.com:
...
| I had assumed that the shell passes what you type for executables
| in the $PATH directly in argv[0]. This is silly of course and
| it just passes appropriate_path_entry+'/'+what_you_type so you can't
| distinguish from argv[0] whether a program was found in the $PATH
| or explicitly specified by the user.

Depends on the shell.  Bash and rc do one thing, ksh does another.
Python does what it should with argv, copies it directly into sys.argv.

	Donn Cave, donn at u.washington.edu



More information about the Python-list mailing list