What happens when the command echo $0 is executed inside a shell script?

TPSC Computer/IT Posts · 2026 · Junior Forensic Digital Analyst · Part III

What happens when the command echo $0 is executed inside a shell script?

  1. A.

    Prints the last exit status

  2. B.

    Prints the invocation name or path used to run the script

  3. C.

    Prints the current working directory

  4. D.

    Prints the value of the first argument to the script

Attempted by 84 students.

Sign up free to check your answer

Sign up free

Explore the full course: Tpsc Assistant Technical Officer

Loading lesson…