Bash Scripting - Variables
Find the error in this bash code:
declare -i val=8 val=val*2 echo $val
declare -i val=8 val=val*2 echo $val
val=val*2 assigns string "val*2" to val, not arithmetic.val=$((val * 2)) to multiply correctly.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions