How do I tell from within a ruby script whether it has been run from the command line or from a non-interactive process? -
How can I tell from within a Ruby script, it has been run from the command line, that is how:
& gt; Ruby myscript.rb Or from a non-interactive process, e.g. Cron?
$ stdin.tty? If the back terminal is otherwise wrong.
Additional information on the question is quite a bit
Comments
Post a Comment