Files
hpr_website/www/eps/hpr3013/hpr3013_bash21_ex2.sh

26 lines
611 B
Bash
Executable File

#!/usr/bin/env bash
#-------------------------------------------------------------------------------
# Example 2 for Bash Tips show 21: the environment
#-------------------------------------------------------------------------------
BTversion='21'
export BTversion
echo "** Using 'grep' with 'env'"
env | grep -E '(EDITOR|SHELL|BTversion)='
echo
echo "** Using 'printenv' with arguments"
printenv EDITOR SHELL BTversion
echo
echo "** Using 'grep' with 'export'"
export | grep -E '(EDITOR|SHELL|BTversion)='
echo
echo "** Using 'grep' with 'declare'"
declare -x | grep -E '(EDITOR|SHELL|BTversion)='
exit