While writing the shell script, the "$?" sign is used with "if statement" to check whether the previous command is executed successfully or not.