Last active
July 5, 2019 09:54
-
-
Save thomasfaingnaert/26ded6bc1efa02c22f28200361b4874e to your computer and use it in GitHub Desktop.
Keep named pipe open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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