Surprising Bash Variables

Surprising Bash Variables

If you’re all about saving time at the command line, then you can use this variable to change directories as easily as you can call commands. This variable tracks how deeply nested you are in the bash shell. Also useful for introspection and debugging is the variable, which reports the number of commands that have been run in the session so far:

This is most often used in debugging scripts.

Source: zwischenzugs.com