You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the Variable substitution within quotes section there's this snippet:
# doubled single quotes act as if there are no quotes at all
echo ''$foo''
# bar
Which is a bit misleading. Bash does not define '' (two single quotes next to each other) as anything special. It's just an empty quote. So what bash does is to concatenate '' (empty) with $foo (variable) with another '' (empty). I think this example should be removed altogether and maybe there can be a section where concatenation is explained in more detail. Any whitespace (more than one, a single whitespace is respected) that is not quoted is ignored. So for example:
echo foo bar baz
# foo bar baz
echo foo ' ' bar ' ' baz
# foo bar baz
What is important to note that you don't have a specific operator or separator to concatenate in bash. That's why you can omit empty spaces and it's still valid:
echo foo' 'bar
# foo bar
echo foo''bar
# foobar
The text was updated successfully, but these errors were encountered:
In the Variable substitution within quotes section there's this snippet:
Which is a bit misleading. Bash does not define '' (two single quotes next to each other) as anything special. It's just an empty quote. So what bash does is to concatenate '' (empty) with $foo (variable) with another '' (empty). I think this example should be removed altogether and maybe there can be a section where concatenation is explained in more detail. Any whitespace (more than one, a single whitespace is respected) that is not quoted is ignored. So for example:
What is important to note that you don't have a specific operator or separator to concatenate in bash. That's why you can omit empty spaces and it's still valid:
The text was updated successfully, but these errors were encountered: