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

23 lines
488 B
Bash
Executable File

#!/usr/bin/env bash
#-------------------------------------------------------------------------------
# Example 4 for Bash Tips show 21: a way of showing environment variables
#-------------------------------------------------------------------------------
#
# We expect one or more arguments
#
if [[ $# = 0 ]]; then
echo "Usage: $0 variable_name"
exit 1
fi
#
# Loop through the arguments reporting their attributes with 'declare'
#
for arg; do
declare -p "$arg"
done
exit