Bash Syntax: What is "<<"?

Can someone explain "<in the following code?

mysql test<<E0Q
Select * from signins

I would try to find it myself, but the characters are hard to find ...

Thanks Dan

+3
source share
5 answers

This is the “file here”, see http://www.linuxjournal.com/article/3771

+8
source

Here's the docs or a way to easily connect large text blocks to a program.

+3
source

. , , Linux From Scratch, heredocs cat (>). :

[email protected] ~$ cat >test.c <<EOF
int main(void){return 0;}
EOF
[email protected] ~$

< < EOF EOF `test.c ', , EOF, .

+3

. :

This type of redirection instructs the shell to read input from the
current source until a line containing only word (with no trailing blanks)  is
seen.   All  of  the lines read up to that point are then used as the standard
input for a command.

The format of here-documents is:

       <<[-]word
               here-document
       delimiter
+2

echo read, , "", . -doc -, :

read -a var <<< "some text"

, , "-", -doc.

. this this.

0
source

Source: https://habr.com/ru/post/1726089/


All Articles