I think there is no big difference here. Yes, it is advisable to enclose a variable in double quotes when that variable is being referenced. However, $x
does not seem to be referenced here in your question.
y=$x
does not by itself affect how whitespaces will be handled. It is only when $y
is actually used that quoting matters. For example:
$ x=" a b "
$ y=$x
$ echo $y
a b
$ echo "$y"
a b
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…