Skip to content

Instantly share code, notes, and snippets.

@a1exlism
Created July 20, 2016 17:25
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 a1exlism/afe86965ce03da94954f540ed7d94b72 to your computer and use it in GitHub Desktop.
Save a1exlism/afe86965ce03da94954f540ed7d94b72 to your computer and use it in GitHub Desktop.
linux pipe
Linux中标准输入为0,标准输出为1,标准错误输出为2
$./a.out 0 就是测试标准输入是否可读。因为默认标准输入是终端,终端是可读可写的。故输出为read write
$ ./a.out 0 < /dev/tty 实际是$ ./a.out 0 0< /dev/tty是把/dev/tty重定向为标准输入,而/dev/tty是只读的,……
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment