Check input device is a terminal: Difference between revisions

→‎{{header|C}}: Added Common Lisp
(Go solution)
(→‎{{header|C}}: Added Common Lisp)
Line 50:
stdin is not tty
</pre>
 
=={{header|Common Lisp}}==
{{Works with|SBCL}}
<lang lisp>(with-open-stream (s *standard-input*)
(format T "stdin is~:[ not~;~] a terminal~%"
(interactive-stream-p s)))</lang>
 
{{Out}}
<pre>$ sbcl --script rc.lisp
stdin is a terminal
$ sbcl --script rc.lisp < /dev/zero
stdin is not a terminal
$ echo "" | sbcl --script rc.lisp
stdin is not a terminal</pre>
 
=={{header|D}}==