Skip to content

Instantly share code, notes, and snippets.

@zjiekai
Last active October 14, 2015 11:32
Show Gist options
  • Save zjiekai/40b678906d052a12f042 to your computer and use it in GitHub Desktop.
Save zjiekai/40b678906d052a12f042 to your computer and use it in GitHub Desktop.
t.sh
while true
do
echo "stderr $(date)" 1>&2
echo "stdout $(date)"
done
bash /tmp/t.sh 2>&1 1>/tmp/output | sleep 9999
可以发现/tmp/output文件的大小并未不断增长,可知进程阻塞
$ dd if=/dev/zero bs=1 | sleep 9999
ctrl-C 后会显示缓冲区的大小
关于重定向
http://stackoverflow.com/a/18342079/264442
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment