cbillson
February 15th, 2013, 06:11 PM
I'm wanting to have defaults to some questions in a test script so i can just press enter if no data changes - currently though it sets the variable to blank... any help on how i can stop it doing this?
In this example i want $testvar to remain as no, however it sets it blank
testvar=no
read -p "change a setting $testvar : " testvar
echo $testvar
In this example i want $testvar to remain as no, however it sets it blank
testvar=no
read -p "change a setting $testvar : " testvar
echo $testvar