Quoting Bash Reference Manual and man bash
(version 4.3):
[n]<<< word
The
word
undergoes brace expansion, tilde expansion, parameter and variable expansion, command substitution, arithmetic expansion, and quote removal. Pathname expansion and word splitting are not performed.
The word
should not undergo word-splitting. However, using this simple code:
var="a b"
cat <<< $var
#output:
#a b
cat <<< "$var"
#output:
#a b
What am I missing? Does this depend on the version of bash
or is there a mistake in the manual? I am using GNU bash, version 4.3.48
.
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin16)
– Hierarchycat
command produce the same output (with no word-splitting). – Serenabash 4.4
. The part about no word-splitting is still present in mybash 4.3
manual from 2014 February though. – Capitolineman bash
(version 4.4) says no word splitting is performed and a repeat of your tests on my machine shows no word splitting. – Serenaman bash
on OSX Sierra (the above mentioned version of bash) says nothing about word splitting for here strings. – Hierarchy