shell iterate all environment variables


for i in `env`
do
    echo $i
done

shell iterate all environment variables, then parse the name and value of every environment variable.


for i in `env`
do
    key=`echo $i | awk -F"=" '{print $1}'`
    val=`echo $i | awk -F"=" '{print $2}'`
    echo $key"-----"$val
    
done