Ruby basic environment variable settings and common interpreter commands, ruby interpreter
Ruby Environment Variables
The Ruby interpreter uses the following environment variables to control its behavior. The ENV object contains a list of all currently set environment variables.
For Unix, run the env command to view the list of all environment variables.
HOSTNAME=ip-72-167-112-17.ip.secureserver.netRUBYPATH=/usr/binSHELL=/bin/bashTERM=xtermHISTSIZE=1000SSH_CLIENT=122.169.131.179 1742 22SSH_TTY=/dev/pts/1USER=amroodJRE_HOME=/usr/java/jdk/jreJ2RE_HOME=/usr/java/jdk/jrePATH=/usr/local/bin:/bin:/usr/bin:/home/guest/binMAIL=/var/spool/mail/guestPWD=/home/amroodINPUTRC=/etc/inputrcJAVA_HOME=/usr/java/jdkLANG=CHOME=/rootSHLVL=2JDK_HOME=/usr/java/jdkLOGDIR=/usr/log/rubyLOGNAME=amroodSSH_CONNECTION=122.169.131.179 1742 72.167.112.17 22LESSOPEN=|/usr/bin/lesspipe.sh %sRUBYLIB=/usr/lib/rubyG_BROKEN_FILENAMES=1_=/bin/env
Ruby command line options
Ruby is generally run from the command line as follows:
$ ruby [ options ] [.] [ programfile ] [ arguments ... ]
The interpreter can be called using the following options to control the interpreter's environment and behavior.
Single-character command line options can be used in combination. The following two lines share the same meaning:
$ ruby -ne 'print if /Ruby/' /usr/share/bin$ ruby -n -e 'print if /Ruby/' /usr/share/bin