开发者

What's the difference between STDIN and tty at all?

开发者_开发问答

Tt seems to be the same whether I read from STDIN and /dev/tty,

so what's the difference at all?


/dev/tty is the controlling terminal for the current process. STDIN is the current input. If you redirect, e.g.,

perl script.pl <myfile.txt

STDIN will now come from myfile.txt, but /dev/tty would still come from the controlling terminal. It's all UNIX, not Perl, and there is much more to it than that, but that's the difference in a nutshell.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜