From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 60006 invoked by alias); 21 Jul 2018 00:59:57 -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 59992 invoked by uid 89); 21 Jul 2018 00:59:56 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.9 required=5.0 tests=BAYES_00,GIT_PATCH_2,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1460, proxy, HContent-Transfer-Encoding:8bit X-HELO: mail.avenger.ws Received: from mail.avenger.ws (HELO mail.avenger.ws) (173.208.129.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 21 Jul 2018 00:59:54 +0000 Received: from [IPv6:2804:14c:5b70:9002:b472:e56f:a088:aa24] (unknown [IPv6:2804:14c:5b70:9002:b472:e56f:a088:aa24]) by mail.avenger.ws (Postfix) with ESMTPSA id 055074E00FB for ; Fri, 20 Jul 2018 21:59:17 -0300 (-03) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=avenger.ws; s=ethereal; t=1532134758; bh=BiOozfM9WYsO+4ieRHHqLSIQtdC8UjDCkraR4WY3gpQ=; h=Subject:To:References:From:Date:In-Reply-To; b=OJaxUm/9BcRNtdzBNQvCcpLlce1hxejNOsbHYX1IQryhYtYC51ZnObXzqadNd8m6q eMVGrOf/aQ6KSSezpgWIphxVnNOD9u980m1CAzyPoDaTmcxiJflEO+d1jdhErcdqhs x5K7sUjpN/QIvHYJWf14MUrnnFORznFL3TAOcpCc= Subject: Re: Why is stdin always a pipe? To: cygwin@cygwin.com References: From: Heavenly Avenger Message-ID: <6a6289ef-a8fe-9faa-ebf5-04e7a5fbe8c6@avenger.ws> Date: Sat, 21 Jul 2018 01:59:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2018-07/txt/msg00203.txt.bz2 My results match Brian Inglis', not João Eiras'. I run cygwin from a putty session (using putty's cygtermd little proxy) if that matters. On 7/20/2018 11:52 AM, Brian Inglis wrote: > On 2018-07-20 07:17, João Eiras wrote: >>>> $ [[ -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 > Are you using a terminal that does not provide a console interface? > That is a pipe; Cygwin terms look like this: > > $ ll -go /dev/std*; ll -go /proc/self/fd/[012]; ll -go /dev/pty? > lrwxrwxrwx 1 15 May 14 2013 /dev/stderr -> /proc/self/fd/2 > lrwxrwxrwx 1 15 May 14 2013 /dev/stdin -> /proc/self/fd/0 > lrwxrwxrwx 1 15 May 14 2013 /dev/stdout -> /proc/self/fd/1 > lrwxrwxrwx 1 0 Jul 20 08:18 /proc/self/fd/0 -> /dev/pty0 > lrwxrwxrwx 1 0 Jul 20 08:18 /proc/self/fd/1 -> /dev/pty0 > lrwxrwxrwx 1 0 Jul 20 08:18 /proc/self/fd/2 -> /dev/pty0 > crw--w---- 1 136, 0 Jul 20 08:18 /dev/pty0 > crw--w---- 1 136, 1 Jul 20 08:18 /dev/pty1 > $ for fd in 0 1 2 3; do test -t $fd; echo fd $fd term $?; done > fd 0 term 0 > fd 1 term 0 > fd 2 term 0 > fd 3 term 1 > $ for f in /dev/{std*,pty?}; do test -p $f; echo file $f pipe $?; done > file /dev/stderr pipe 1 > file /dev/stdin pipe 1 > file /dev/stdout pipe 1 > file /dev/pty0 pipe 1 > file /dev/pty1 pipe 1 > > where ptys are terms and are not pipes. > -- 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