bash - Variable variable assignment error -"command not found" -
when run script following errors. doing wrong here please? appreciated- bash newbie
error:
line 12: 0=1: command not found line 13: 0=1: command not found
my script:
count_raw=0 avg_raw=0 $count_raw=1 $avg_raw=1 echo "count_raw=$count_raw" echo "avg_raw=$avg_raw"
=
assignment operator when found free , $
holds value (not in usa in bash too) of variable.
so when say: $var=1
, you're trying type random string (0=1
in case) in bash , bash doesn't that. @ one-liner below shows 1 example you'd type in $var=1
, bash able process it:
var=1; if [[ $var=1 ]]; printf "congrats! have learned difference between variable assignment , variable comparison in ${var}st attempt.\n"; fi;
Comments
Post a Comment