I am trying to learn shell scripting and I am kind of confused with the idea of := or default value
#!/bin/sh
echo "Please enter a number \c"
read input
input=$((input % 2))
if [ $input -eq 0 ]
then
echo "The number is even"
else
echo "The number is odd"
fi
echo "Beginning of second part"
a="BLA"
a="Dennis"
echo $a
unset a
echo "a after unsetting"
echo $a
${a:=HI}
echo "unsetting a again"
unset a
echo $a
And I get this
Dennis
a after unsetting
./ifstatement.sh: line 21: HI: command not found
unsetting a again