27.08.2015 Views

Advanced Bash−Scripting Guide

Advanced Bash-Scripting Guide - Nicku.org

Advanced Bash-Scripting Guide - Nicku.org

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

$EDITOR<br />

the default editor invoked by a script, usually vi or emacs.<br />

$EUID<br />

"effective" user id number<br />

Identification number of whatever identity the current user has assumed, perhaps by means of su.<br />

The $EUID is not necessarily the same as the $UID.<br />

$FUNCNAME<br />

name of the current function<br />

xyz23 ()<br />

{<br />

echo "$FUNCNAME now executing." # xyz23 now executing.<br />

}<br />

xyz23<br />

<strong>Advanced</strong> <strong>Bash−Scripting</strong> <strong>Guide</strong><br />

echo "FUNCNAME = $FUNCNAME" # FUNCNAME =<br />

# Null value outside a function.<br />

$GLOBIGNORE<br />

A list of filename patterns to be excluded from matching in globbing.<br />

$GROUPS<br />

groups current user belongs to<br />

This is a listing (array) of the group id numbers for current user, as recorded in /etc/passwd.<br />

root# echo $GROUPS<br />

0<br />

root# echo ${GROUPS[1]}<br />

1<br />

root# echo ${GROUPS[5]}<br />

6<br />

$HOME<br />

home directory of the user, usually /home/username (see Example 9−13)<br />

$HOSTNAME<br />

The hostname command assigns the system name at bootup in an init script. However, the<br />

gethostname() function sets the Bash internal variable $HOSTNAME. See also Example 9−13.<br />

$HOSTTYPE<br />

host type<br />

Like $MACHTYPE, identifies the system hardware.<br />

$IFS<br />

bash$ echo $HOSTTYPE<br />

i686<br />

input field separator<br />

Chapter 9. Variables Revisited 65

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!