Skip to content

Instantly share code, notes, and snippets.

@tateisu
Created August 26, 2019 03:11
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 tateisu/cb0c9ee75ab9eae1b7138d8bc6c4a6b6 to your computer and use it in GitHub Desktop.
Save tateisu/cb0c9ee75ab9eae1b7138d8bc6c4a6b6 to your computer and use it in GitHub Desktop.
$ cat readpipe.sh
#!/bin/bash
FILE=/tmp/test.pipe
rm $FILE
mknod $FILE p
read -t 3 <>$FILE answer
echo $? $answer
$ cat writepipe.sh
#!/bin/bash
FILE=/tmp/test.pipe
echo "test" >$FILE
ターミナルを二つ開いて片方で readpipe.sh を、もう片方でwritepipe.shを実行する
タイムアウトを取れるし出力内容を受け取れる
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment