Created
June 11, 2011 00:57
-
-
Save morganp/1020125 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#VAR is then name of the variable to look for | |
VAR=$1 | |
eval test=\${$VAR} | |
if [ "$test" == "" ] | |
then | |
echo "Enviroment Variable $VAR has not been set" | |
echo "enter value then press return" | |
#CAPTURE='test' | |
read -e CAPTURE | |
# Set it now in the Enviroment | |
#export $VAR=$CAPTURE | |
#echo "export $VAR='$CAPTURE'" | |
# Add to bashrc so will it be set next time | |
echo "export $VAR=$CAPTURE" >> ~/.bashrc | |
else | |
echo "$VAR is set to $test" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment