开发者

Is the keyword "STDOUT" ruby- or cygwin-specific in this command?

The fol开发者_如何学JAVAlowing command which you can use in the cygwin console to output text in this console.

ruby -e 'STDOUT << "ABC" << " DEF"'

My question is: the STDOUT part is a ruby keyword or a cygwin keyword? How can I use it? Great thanks.


STDOUT is a Ruby global constant. It is an instance of the IO class that outputs to standard output stream. $> and $stdout are references to the same IO instance.

In your example, you are calling the << method of IO, which writes out the argument and then returns itself.


STDOUT is a pre-defined global constant in Ruby. You can also use $stdout or $>.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜