What does <<<
mean in this command line?
bc <<< "1 + 1"
It doesn't seem to a combination of <
and <<
, and I can't find documentation for it. It seems to behave just like
echo "1 + 1" | bc
Also works in ksh
, but not in sh
.
What does <<<
mean in this command line?
bc <<< "1 + 1"
It doesn't seem to a combination of <
and <<
, and I can't find documentation for it. It seems to behave just like
echo "1 + 1" | bc
Also works in ksh
, but not in sh
.
It introduces a here string, documented near the end of the section on input and output redirections. A here string is just a one-word here document:
bc <<< "1 + 1"
is equivalent to
bc <<EOF
1 + 1
EOF