there are some special automatically set environment variabels that might be interesting to know…

echo $$; # PID of currently running shell
echo $?; # return error code of last run program (before echo)
echo $0; # return /path/and/way the script/command was started (by a softlink or directly?)
echo $#; # number of parameters passed to script/program

Links:

http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_03_02.html

liked this article?

  • only together we can create a truly free world
  • plz support dwaves to keep it up & running!
  • (yes the info on the internet is (mostly) free but beer is still not free (still have to work on that))
  • really really hate advertisement
  • contribute: whenever a solution was found, blog about it for others to find!
  • talk about, recommend & link to this blog and articles
  • thanks to all who contribute!
admin