Check input device is a terminal: Difference between revisions

Content added Content deleted
(→‎{{header|Julia}}: A new entry for Julia)
Line 116: Line 116:
> hello </dev/null
> hello </dev/null
Who are you? You're not a terminal.
Who are you? You're not a terminal.
</pre>

=={{header|Julia}}==
<lang Julia>
if isa(STDIN, Base.TTY)
println("This program sees STDIN as a TTY.")
else
println("This program does not see STDIN as a TTY.")
end
</lang>

{{out}}
<pre>
This program sees STDIN as a TTY.
</pre>
</pre>