bashshellherestring

What does the Bash operator <<< (i.e. triple less than sign) mean?


What does the triple-less-than-sign bash operator, <<<, mean, as inside the following code block?

LINE="7.6.5.4"
IFS=. read -a ARRAY <<< "$LINE"
echo "$IFS"
echo "${ARRAY[@]}"

Also, why does $IFS remain to be a space, not a period?


Solution

  • It redirects the string to stdin of the command.

    Variables assigned directly before the command in this way only take effect for the command process; the shell remains untouched.