Can you give examples for uses of. Mean in shell programming?true echo $ # echoes 0 false echo $ # echoes 1 from the manual (acessible by calling man bash in your shell) Expands to the exit status of the most recently executed foreground pipeline
Learn more about exit statuses on wikipedia I often come across $?, $0, $1, $2, etc in shell scripting Returns the exit status of the last command Echo "this will return 0" But what do the others do There are many shell implementations available, like sh, bash, c shell, z shell, etc.
Asked 14 years, 10 months ago modified 2 years, 5 months ago viewed 683k times When going through one shell script, i saw the term $? What is the significance of this term? You'll need to complete a few actions and gain 15 reputation points before being able to upvote Upvoting indicates when questions and answers are useful What's reputation and how do i get it
Instead, you can save this post to reference later. Is the pid of the most recent background command $0 is the name of the shell or shell script Most of the above can be found under special parameters in the bash reference manual Here are all the environment variables set by the shell For a comprehensive index, please see the reference manual variable index.
WATCH