Why is stdin always a pipe?
João Eiras
joao.eiras@gmail.com
Fri Jul 20 15:12:00 GMT 2018
>> $ [[ -p /dev/stdin ]] && echo pipe || echo nopipe
>> nopipe
Interesting, it's always a pipe for me. What about ls ?
$ ls -l /dev/stdin
prw------- 1 user None 0 Jun 4 15:54 /dev/stdin
>> $ [[ -t /dev/stdin ]] && echo term || echo noterm
>> noterm
The '-t' operator is used with file descriptors, so "[[ -t 0 ]]"
http://tldp.org/LDP/abs/html/fto.html
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
More information about the Cygwin
mailing list