Advanced

Bash Heredoc

Posted by linuxize on
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

» Get new stories by e-mail: nightly or as they are published

« Return to the newswire homepage

  Related stories
» More like this

This topic does not have any threads posted yet!

You cannot post until you login.