Examples of showing the value of variables

In the C and TC shell, to show the values of all your environment variables:

   printenv
   TERM=vt100
   HOME=/home/eucs/helper
   SHELL=/usr/local/bin/Tcsh
   USER=helper
   TZ=GMT0BST
   UCBPATH=:/usr/ucb:/bin:/usr/bin
   ATTPATH=:/bin:/usr/bin
   UCBSHELL=/usr/local/bin/Tcsh
   ATTSHELL=/bin/sh
   LOGNAME=helper
   MAIL=/home/eucs/helper/.mail

This shows that this user's terminal type is set to VT100, that they use the TC shell and that they are on Greenwich Mean Time.


In the Bourne, BASH and Korn shell, to show the value of all your variables:

   set
   BASH=/usr/local/utils/bin/bash
   BASH_VERSION=1.12.1
   DELIVERY=John Smith Room 2004 JCMB
   DISPLAY=frolix8.ucs:0
   EDITOR=ue
   FOLDERS=/home/eucs/erpl08/Mail
   HISTFILE=/home/eucs/erpl08/.bash_history
   HISTFILESIZE=50
   HISTSIZE=100
   HOME=/home/eucs/erpl08

...

This shows the value of an assorted range of variables.


[Home] [Search] [Index] This site maintained by unixhelp@mathcs.duq.edu