From: "João Eiras" <joao.eiras@gmail.com>
To: cygwin@cygwin.com
Subject: Re: Why is stdin always a pipe?
Date: Fri, 20 Jul 2018 15:12:00 -0000 [thread overview]
Message-ID: <CAJ+sA06X2dvZtCr7B2rLOH615++eG+s5QsYVg-nOqRd_4HMZyQ@mail.gmail.com> (raw)
In-Reply-To: <e61f4fcb-96cd-699b-85b8-314f1ff96e2e@gmail.com>
>> $ [[ -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
next prev parent reply other threads:[~2018-07-20 13:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-20 13:17 João Eiras
2018-07-20 14:52 ` David Macek
2018-07-20 15:12 ` João Eiras [this message]
2018-07-21 0:59 ` Brian Inglis
2018-07-21 1:59 ` Heavenly Avenger
2018-07-21 2:31 ` João Eiras
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAJ+sA06X2dvZtCr7B2rLOH615++eG+s5QsYVg-nOqRd_4HMZyQ@mail.gmail.com \
--to=joao.eiras@gmail.com \
--cc=cygwin@cygwin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).