Last active
December 20, 2015 17:09
-
-
Save knjname/6166459 to your computer and use it in GitHub Desktop.
名前付きパイプを適当に使ってみよう!
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
| #!/bin/bash | |
| # named pipe 生成! | |
| mkfifo hoge_pipe | |
| # 実際にそのファイルが存在している | |
| ls -l hoge_pipe | |
| # named pipe からの入力の行数を測るようにセッティング | |
| wc -l < hoge_pipe & | |
| # named pipe に入力を与えてやる => 100を表示して wc -l < hoge_pipe & は終了 | |
| yes | head -100 > hoge_pipe | |
| # まだファイルは存在している | |
| ls -l hoge_pipe | |
| # ファイルは消すことが可能 | |
| # rm hoge_pipe | |
| # 削除しないままプロセスが完了してもファイルは存在しつづける |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment