Check input device is a terminal: Difference between revisions
Content added Content deleted
m (replaced tty by terminal.) |
|||
Line 260: | Line 260: | ||
<lang Nim>import terminal |
<lang Nim>import terminal |
||
echo if stdin.isatty: "stdin is a |
echo if stdin.isatty: "stdin is a terminal" else: "stdin is not a terminal"</lang> |
||
{{out}} |
{{out}} |
||
<pre>Command: ./check_input_dev |
<pre>Command: ./check_input_dev |
||
Result: stdin is a |
Result: stdin is a terminal</pre> |
||
<pre>Command: ./check_input_dev <somefile |
<pre>Command: ./check_input_dev <somefile |
||
Result: stdin is not a |
Result: stdin is not a terminal</pre> |
||
=={{header|OCaml}}== |
=={{header|OCaml}}== |