これはあなたが代用できる方法のほとんどを持っています
echo "$\{var}"
echo "Substitute the value of var."
echo "1 - $\{var:-word}"
echo "If var is null or unset, word is substituted for var. The value of var does not change."
echo "2- $\{var:=word}"
echo "If var is null or unset, var is set to the value of word."
echo "5-$\{var:?message}"
echo "If var is null or unset, message is printed to standard error. This checks that variables are set correctly."
echo "3 - $\{var:+word}"
echo "If var is set, word is substituted for var. The value of var does not change."