From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19647 invoked by alias); 20 Jul 2018 13:17:45 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 18927 invoked by uid 89); 20 Jul 2018 13:17:44 -0000 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 Received: from mail-oi0-f49.google.com (HELO mail-oi0-f49.google.com) (209.85.218.49) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 20 Jul 2018 13:17:43 +0000 Received: by mail-oi0-f49.google.com with SMTP id l10-v6so21289428oii.0 for ; Fri, 20 Jul 2018 06:17:42 -0700 (PDT) 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 Received: by 2002:a9d:507:0:0:0:0:0 with HTTP; Fri, 20 Jul 2018 06:17:00 -0700 (PDT) In-Reply-To: References: From: =?UTF-8?Q?Jo=C3=A3o_Eiras?= Date: Fri, 20 Jul 2018 15:12:00 -0000 Message-ID: Subject: Re: Why is stdin always a pipe? To: cygwin@cygwin.com Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2018-07/txt/msg00198.txt.bz2 >> $ [[ -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