Skip to content

Instantly share code, notes, and snippets.

@ctrngk
Forked from torgeir/namedPipes.sh
Created February 28, 2017 04:49
Show Gist options
  • Save ctrngk/23aabc4c08ea869c1999da707fa88d2a to your computer and use it in GitHub Desktop.
Save ctrngk/23aabc4c08ea869c1999da707fa88d2a to your computer and use it in GitHub Desktop.
how to message daemon process - bash pipe as stdin
# create pipe, tail it, and read from stdin in a program
mkfifo namedPipe; tail -f namedPipe | while true; do read msg; echo $msg; done;
# now send messages from another shell
echo "start" > namedPipe
echo "stop" > namedPipe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment