Skip to content

Instantly share code, notes, and snippets.

@tamboer
Last active September 13, 2016 15:31
Show Gist options
  • Select an option

  • Save tamboer/6447256 to your computer and use it in GitHub Desktop.

Select an option

Save tamboer/6447256 to your computer and use it in GitHub Desktop.
shell scripting
============================================================================
printenv = print environment variables or what php calls global variables
TERM=xterm
SHELL=/bin/bash
USER=user
DEFAULTS_PATH=/usr/share/gconf/xubuntu.default.path
XDG_CONFIG_DIRS=/etc/xdg/xdg-xubuntu:/etc/xdg:/etc/xdg
PATH=/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
DESKTOP_SESSION=xubuntu
PWD=/home/user
LANG=en_US.UTF-8
MANDATORY_PATH=/usr/share/gconf/xubuntu.mandatory.path
GDMSESSION=xubuntu
HOME=/home/user
LANGUAGE=en_US:en
LOGNAME=user
============================================================================
http://www.thegeekstuff.com/2010/06/bash-array-tutorial/
Print the Whole Bash Array
There are different ways to print the whole elements of the array. If the index number is @ or *, all members of an array are referenced. You can traverse through the array elements and print it, using looping statements in bash.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment