0

I know what this one does, I learned "pattern like" and just works.

I also know:

  • that > is a redirect to a file
  • that << is also a redirect to file see below
  • EOF is just a placeholder, when detected the file is closed

Can someone explain the inner workings of those instructions? Why does that work ?

Correction: the use of ´<<` is described in the man page of bash as:

<<[-]word
    here-document
delimiter

So it is the current source that is read from, which I think is stdin. Could someone decompose this into smaller chunks, that I can understand?

I think delimiter corresponds to EOF in my example, right?

And here-document is probably the text I type in in stdin, right?

I fail to see what is word.

Ely
  • 159
  • 9
  • 1
    `<<` is _not_ a redirect from a file. `< – John1024 May 18 '15 at 00:31
  • 1
    There are many, *many* references on how to use the shell on the Internet (and some of them are clear and accurate).  Start by reading *the very next paragraph* of `bash(1)` after the block you quoted; also check [What are the shell's control and redirection operators?](http://unix.stackexchange.com/q/159513/23408) (here on Stack Exchange).  Please do some research on your own, and let us know if something specific is hard to understand. – Scott - Слава Україні May 18 '15 at 01:43
  • Your link is perfect. The use of two different identifiers "word" and "delimiter" was confusing, they are actually the same. Thanks. – Ely May 18 '15 at 01:50

0 Answers0