Hi guys,
The following 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.
Hi guys,
The following 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 pre-defined global constant in Ruby. You can also use $stdout or $>.
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.