delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2018/07/20/09:17:55

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:in-reply-to:references:from:date
:message-id:subject:to:content-type; q=dns; s=default; b=jA44Zkq
lLR5bjIOI5PB2da20Ib91gMx0OOaSWNWz2CUbNhP0Ke+853S/UrGsxoTn+YAkmb5
PS4/2PSdUpeB4B08G5bgOC8hEk4H3E4RzygHwBi3o6QIsmlnb6G/uSDvzwqySL1U
vvHY9X2OTGBPEOh70jtJG4c1ZP+TFRwUZ1fY=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:in-reply-to:references:from:date
:message-id:subject:to:content-type; s=default; bh=3iKoDytmr4GML
GGFDEWMsCeMOkM=; b=g0Mej+14rkRDKR6vkEhc1uEKZ0i1+hVt/mfeLUxRRdxNN
lXf5oodcfyDYcgt5RjPgogzZRQruXtY3tnpVt9CVA7Er6UBpmrGgoR2pFKGKdoln
hrnGjdHvX2JYKckJbwjJ5g66XqcgIT8xstO25G0Ga9reygef2n+LCNzY+1ZpYE=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Spam-SWARE-Status: No, score=-6.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_2,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=
X-HELO: mail-oi0-f49.google.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=shah5Id94gHh9r0bQq15acfEh0dLMbUZckNlm+XheK0=; b=MIzb4JrSQKhCQZT3+fIKAajorEbfYP3vDLEjuAmXlZhPG/R4LJNVrnsgYbqSpPS6lb M80lOYz1jaQFxE9IF4Z3Y4RFkRAYcaLi4JLT2QrcSd4vmAjt96WkMjclZUwbMmAnJTKu tDtMhX+99cPEazc5TUR+FAaQ99w1RfxQGEEpD2V7XiYgSEwLskw55Jo18GPMPvgjJ2I/ vBiNVc5/LO5Pp/oUooZz8ocIDuEmkUxDu8TRqWrcWCo5cUY+En1pMf+uwlvNmD9L7b6i MtZOvkCnmabJjr7MZ50wqdo6opgTDKbmk6caKbBAyYW4U/9TlL2Eby30exHSfidAvtcI rO/w==
MIME-Version: 1.0
In-Reply-To: <e61f4fcb-96cd-699b-85b8-314f1ff96e2e@gmail.com>
References: <CAJ+sA06u+pfPpTeFDQYaaT52c5_yz98i+MaTH28DCJoZkVc7=g AT mail DOT gmail DOT com> <e61f4fcb-96cd-699b-85b8-314f1ff96e2e AT gmail DOT com>
From: =?UTF-8?Q?Jo=C3=A3o_Eiras?= <joao DOT eiras AT gmail DOT com>
Date: Fri, 20 Jul 2018 15:17:00 +0200
Message-ID: <CAJ+sA06X2dvZtCr7B2rLOH615++eG+s5QsYVg-nOqRd_4HMZyQ@mail.gmail.com>
Subject: Re: Why is stdin always a pipe?
To: cygwin AT cygwin DOT com
X-IsSubscribed: yes

>> $ [[ -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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019