RosettaCodeData/Task/Program-name/00-TASK.txt
2023-07-01 13:44:08 -04:00

8 lines
430 B
Text

The task is to programmatically obtain the name used to invoke the program. (For example determine whether the user ran "python hello.py", or "python hellocaller.py", a program importing the code from "hello.py".)
Sometimes a [[multiline shebang]] is necessary in order to provide the script name to a language's internal ARGV.
See also [[Command-line arguments]]
Examples from [https://github.com/mcandre/scriptname GitHub].