Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • Can you give an (hopefully real-world) example of the second para? Commented Aug 27, 2014 at 10:40
  • Careful with the analogy with argv[0]. $0 is only set to the argv[0] passed to execve() when it's like sh or bash. For scripts, $0 is set to the path given as argument 1, 2... to the interpreter (and for scripts executed directly, that comes from the first path argument to execve()). Commented Aug 27, 2014 at 11:06