Bash Heredoc

Posted by linuxize on May 10, 2019 6:30 AM EDT
linuxize.com; By linuxize
Mail this story
Print this story

Here document (Heredoc) is a type of redirection that allows you to pass multiple lines of input to a command.

When writing shell scripts you may be in a situation where you need to pass a multiline block of text or code to an interactive command, such as tee, cat, or sftp.

In Bash and other shells like Zsh, a Here document (Heredoc) is a type of redirection that allows you to pass multiple lines of input to a command.

The syntax of writing HereDoc takes the following form:

Full Story

  Nav
» Read more about: Groups: GNU, Linux

« Return to the newswire homepage

This topic does not have any threads posted yet!

You cannot post until you login.