What Is Dollar Question Mark in Unix?
Contents This Control Operator Is Used to Check the Status of Last Executed Command. If Status Shows ‘0’ Then Command Was Successfully Executed and If Shows...
Contents
This control operator is used to check the status of last executed command. If status shows ‘0’ then command was successfully executed and if shows ‘1’ then command was a failure. The exit code of the previous command is stored in the shell variable $?.
What does $? Mean in Unix?
$? = was last command successful. Answer is 0 which means ‘yes’.
Must Read
What is $1 UNIX script?
$1 is the first command-line argument passed to the shell script. Also, know as Positional parameters. … $0 is the name of the script itself (script.sh) $1 is the first argument (filename1) $2 is the second argument (dir1)