Skip to content

Instantly share code, notes, and snippets.

@dbrock
Last active April 19, 2024 03:18
Show Gist options
  • Select an option

  • Save dbrock/7128016 to your computer and use it in GitHub Desktop.

Select an option

Save dbrock/7128016 to your computer and use it in GitHub Desktop.
Sometimes you need to use multiple heredocs in a single command. This is possible in Bash using process substitution.
#!/usr/bin/env bash
cat <<. |
1
.
diff <<. - <(cat) |
2
.
diff <<. - <(cat) |
3
.
diff <<. - <(cat)
4
.
@sarnobat
Copy link
Copy Markdown

I'm assuming this isn't possible with dash right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment