Check output device is a terminal: Difference between revisions

Content added Content deleted
(Added Kotlin)
(Added section on PHP)
Line 240: Line 240:
False</pre>
False</pre>


=={{header|PHP}}==
<lang php>
if(posix_isatty('/dev/stdout')) {
echo "The output device is a terminal".PHP_EOL;
} else {
echo "The output device is NOT a terminal".PHP_EOL;
}
</lang>
=={{header|Python}}==
=={{header|Python}}==
Pretty much the same as [[Check input device is a terminal#Python]].
Pretty much the same as [[Check input device is a terminal#Python]].