It seemed to me that the end of a here string is newline. I realize I am wrong:
$ cat <<< hello world cat: world: No such file or directory
What can signify the end of a here string?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
where a word is a sequence of characters treated as a unit by the shell, delimited by whitespace. That could be a single regular word (
hello), a single- or double-quoted string (
"hello world"), a parameter or command substitution (
$(...)), something assembled with backslash escapes, or a combination of those joined together.
You can have multiple here-documents or here-strings on a single line, so the end of the line can't work as the only delimiter, though it will end there if not already (unless the newline is backslash-escaped).
You would get the effect you wanted with
cat <<<'hello world'
cat <<<hello\ world
From the manual:
The end is one word, not multiple words. So in this example, the first word is
hello and terminates the here string. The next word is
world, it is just an ordinary argument to
cat assumes it is a file name to read.
You could write it more clearly this way:
$ cat world <<< hello