2

From https://unix.stackexchange.com/a/32227/674

The main places where it's safe not to use the double quotes are:

  • in an assignment: foo=$bar (but note that you do need the double quotes in export "foo=$bar" or in array assignments like array=("$a" "$b"));
  1. Does it mean that it is not required to double quote $bar in assignment foo=$bar? Why?

  2. Why do we need the double quotes in export "foo=$bar" and in array assignments like array=("$a" "$b")?

Thanks.

Tim
  • 101,790