-1

I found this code in a script at the end of a while loop

done <<< $filenames

In the script, $filenames is a variable used to collect a list of files from a database. The loop processes each sub-string in the $filenames list. The question I have is what does the <<< do?

Barmar
  • 669,327
  • 51
  • 454
  • 560
cbcalvin
  • 11
  • 1

2 Answers2

1

<<< is essentially a one-line heredoc (a "here string").

$ cat <<< blah
blah

which is equivalent to a heredoc like:

$ cat <<EOF
> blah
> EOF
blah
FatalError
  • 50,375
  • 14
  • 97
  • 115
0

<<< operator is used to fed input to the corresponding command on it's left side.

Avinash Raj
  • 166,785
  • 24
  • 204
  • 249