I read the bash man page on this, but I do not understand the difference. I tested both of them out and they seem to produce the exact same results.
I want to set a
You cannot see the difference with your examples as you're using var
two times, but you can see it with two different variables:
foo=${bar:-something}
echo $foo # something
echo $bar # no assignement to bar, bar is still empty
foo=${bar:=something}
echo $foo # something
echo $bar # something too, as there's an assignement to bar