Skip to content

Instantly share code, notes, and snippets.

@thomasfaingnaert
Last active July 5, 2019 09:54
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 thomasfaingnaert/26ded6bc1efa02c22f28200361b4874e to your computer and use it in GitHub Desktop.
Save thomasfaingnaert/26ded6bc1efa02c22f28200361b4874e to your computer and use it in GitHub Desktop.
Keep named pipe open
#!/usr/bin/env bash
mkfifo pipe # Created named pipe
program <pipe & # Start program
exec 3>pipe # Open file descriptor 3, writing to the named pipe
# Write to pipe using printf, echo, cat, ...
exec 3>&- # Close the named pipe (file descriptor 3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment