In a lot of shells <<<
denotes a here string and is a way to pass standard input to commands. <<<
is used for strings, e.g.
$ python3 <<< 'print("hi there")'
hi there
It passes the word on the right to the standard input of the command on the left.
whereas <<
denotes a here document, e.g.
command <<MultiLineDoc
Standard Input
That
Streches many
Lines and preserves
indentation and
linebreaks
which is useful for passing many arguments to a command,
e.g. passing text to a program and preserving its indentation.
The beginning and ending _MultiLineDoc_ delimiter can be named any way wanted,
it can be considered the name of the document.
Important is that it repeats identically at
both beginning and end and nowhere else in the
document, everything between that delimiter is passed.
MultiLineDoc
<
is used for passing the contents of a file, e.g. command < filename.txt
As for your example with <<< :
You could do the same with |
but that's only OK if all your variables are defined in what you are passing. If you do have other variables that you have defined in your environment and which you wish to cross reference you would use a here-string as in your example, that lets you reference other variables within the content you are passing.
Please see: https://en.wikipedia.org/wiki/Here_document
https://linuxhint.com/bash-heredoc-tutorial/