Skip to content

Values#

The value can be practically anything. Looking at our list above, let's review a examples:

  • SSH_CLIENT=10.0.2.2 59411 22
  • LESSCLOSE=/usr/bin/lesspipe %s %s
  • OLDPWD=/home/michael/number_game

The SSH_CLIENT variable contains a string with spaces () in it. It's one value, but it's made up of three "words". Straight from the OpenSSH client documentation, we can find out what this means:

SSH_CLIENT shows the address of the client system, the outgoing port number on the client system, and the incoming port on the server. - OPenSSH Client Applications

The LESSCLOSE variable contains the path to an executable (which I know because it's inside the /usr/bin/ directory), followed by two %s. Those %ss are probably there for parameters and would be substituted for actual values.

And the OLDPWD variable can be a useful thing to have. If you use cd to change directory like I have, OLDPWD will contain the previous location, on the file system, that you existed at. Give this a try: cd $OLDPWD

1
2
3
4
5
6
7
michael@develop:~$ pwd
/home/michael
michael@develop:~$ cd $OLDPWD
michael@develop:~/number_game$ pwd
/home/michael/number_game
michael@develop:~/number_game$ echo $OLDPWD
/home/michael

Magic!