Skip to content

Instantly share code, notes, and snippets.

@dbrock
Last active April 19, 2024 03:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dbrock/7128016 to your computer and use it in GitHub Desktop.
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

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