Last active
December 21, 2016 17:38
-
-
Save plaster/ef2fab0230a6916b78ca535a3e2a60ff to your computer and use it in GitHub Desktop.
tee pipe
This file contains 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
ル╹ヮ╹ルɔ jolokia:~ | |
% (yes | tee /tmp/yes.txt | while read; do sleep 1; done) & | |
[1] 303 | |
ル╹ヮ╹ルɔ jolokia:~ | |
% while true; do sleep 1; ls -lh /tmp/yes.txt; done | |
-rw-r--r-- 1 plaster plaster 64K Dec 22 02:20 /tmp/yes.txt | |
-rw-r--r-- 1 plaster plaster 64K Dec 22 02:20 /tmp/yes.txt | |
-rw-r--r-- 1 plaster plaster 64K Dec 22 02:20 /tmp/yes.txt | |
-rw-r--r-- 1 plaster plaster 64K Dec 22 02:20 /tmp/yes.txt | |
-rw-r--r-- 1 plaster plaster 64K Dec 22 02:20 /tmp/yes.txt | |
-rw-r--r-- 1 plaster plaster 64K Dec 22 02:20 /tmp/yes.txt | |
-rw-r--r-- 1 plaster plaster 64K Dec 22 02:20 /tmp/yes.txt | |
-rw-r--r-- 1 plaster plaster 64K Dec 22 02:20 /tmp/yes.txt | |
^C |
This file contains 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
# thanks to @hio: https://twitter.com/hio/status/811624580364144640 | |
ル╹ヮ╹ルɔ jolokia:~ | |
% (yes | strace -e write -o /tmp/tee-strace.log tee /tmp/yes.txt | while read; do sleep 1; done) & | |
[1] 738 | |
ル╹ヮ╹ルɔ jolokia:~ | |
% tail -f /tmp/tee-strace.log | |
write(3, "y\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\n"..., 8192) = 8192 | |
write(1, "y\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\n"..., 8192) = 8192 | |
write(3, "y\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\n"..., 8192) = 8192 | |
write(1, "y\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\n"..., 8192) = 8192 | |
write(3, "y\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\n"..., 8192) = 8192 | |
write(1, "y\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\n"..., 8192) = 8192 | |
write(3, "y\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\n"..., 8192) = 8192 | |
write(1, "y\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\n"..., 8192) = 8192 | |
write(3, "y\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\n"..., 8192) = 8192 | |
write(1, "y\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\n"..., 8192 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment