Friday, July 22, 2005

Quoting during command substitution

I was corrected in #bash channel in irc by trash regarding this.

During variable assignment,its better to quote the rhs.

For example

$myvar="hello world"


but this isnt needed if you are doing something like

$myvar="$(echo hello world)"



As this is equivalent to
$myvar=$(echo hello world)


0 Comments:

Post a Comment

<< Home