In short, it's an easy way of including short bits of text inside the shell script without having to do excessive amounts of quoting, and without having to create a separate file.
Did you read and understand the link Salem posted?
XXX is nothing special, it's just a piece of text. The sed script is used to replace it with something else, in this case the contents of the value variable.
The content of the here-document is passed as input to the command on left side of the less-then signs ( < ).
So in the first code the [tt]cat[/tt] command get the text and output it. In the second code the [tt]sed[/tt] command get the text, execute the [tt]s///[/tt] command on the text, then output it.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.