From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 37404 invoked by alias); 1 Oct 2017 17:16:51 -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 37392 invoked by uid 89); 1 Oct 2017 17:16:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=3.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=H*F:D*tv, Mihaly, mihaly, H*c:alternative X-HELO: mail-it0-f42.google.com Received: from mail-it0-f42.google.com (HELO mail-it0-f42.google.com) (209.85.214.42) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 01 Oct 2017 17:16:48 +0000 Received: by mail-it0-f42.google.com with SMTP id v62so4108936itd.0 for ; Sun, 01 Oct 2017 10:16:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to; bh=HMe+enozPTIc05xEs8NNrH4itvVfi7m5j1RHtQFF+A4=; b=EcGOq2iwiaPysX49OQvMdk1bIesZwi9s7tRLsSV5MwjYKVlhigCIvhxXgNVpMXEGzk 5iHlNRap2hUPHQKGw7kvmND/9ZM3nkfRT7BHvjiaRWfJBO+0m5rQ98HRruCS6/RslNLQ D/YPbsFLeuMXXaRExAwcK2GqqVWj1K7J+gy4Evncg0Q5Bm2StWOtixTNduTsknZtOsVm 1kIG1EeAUl5UdDtlTu9497AQv/3X3EO80A5BsTAVe557G50xZcaJeIBJWIkTCAqDiKIe 438UNAsmjq1BIyl9je7+KzHTJ4cWAA/afDQfOb2BDMMA2bIZW6TXyszPHAB2OeC3ag0i VNgw== X-Gm-Message-State: AMCzsaXopLxcisoJMXhSTHKREqk/03KTeBZt2Suzsllc3wY5vwWKzZvi Uy7Va0Wo/7KNqKS2AraRruMc9od/KrdmLElSKTw= X-Google-Smtp-Source: AOwi7QCX6EddY99IfXdtecD8go+W4bd89VGFwOnaJ8ts8kWN6kRevdd4y5qDoUPbJHELJGlR1QgfFtGe97OuAcntT+Y= X-Received: by 10.36.213.69 with SMTP id a66mr10423091itg.89.1506878206300; Sun, 01 Oct 2017 10:16:46 -0700 (PDT) MIME-Version: 1.0 Received: by 10.2.14.132 with HTTP; Sun, 1 Oct 2017 10:16:25 -0700 (PDT) In-Reply-To: <59d11f4f.3b189d0a.39b5f.144a@mx.google.com> References: <8f69ce8f-1092-abdb-e19d-85018ef0c260@informatik.hu> <59d11f4f.3b189d0a.39b5f.144a@mx.google.com> From: Wouter van Doorn Date: Sun, 01 Oct 2017 17:16:00 -0000 Message-ID: Subject: Re: bash command substitution To: cygwin@cygwin.com Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2017-10/txt/msg00006.txt.bz2 Try the following: echo $(echo hello | cat) If that remains empty, (it should of course result in 'hello') you're suffering from the same problem I have. And no, I did not get it resolved. In which case I'd be elated if you could get anyone interested in finding a solution! If this happens to you, too, then the problem is that the pipe in a subshell simply does not work. For the vast majority, it DOES work. On 1 October 2017 at 18:01, Steven Penny wrote: > On Sun, 1 Oct 2017 08:40:51, Vukovics Mihaly wrote: > >> VHEIGHT=$(ffprobe -v error -show_entries stream=width,height -of >> default=noprint_wrappers=1 ${OLDFILE} | grep "height" | cut -f2 -d'=') >> >> For debugging purpose the same command is executed without putting the >> result into a variable, and works! Does anyone know why is it not working >> in cygwin? >> > > I am not having this trouble: > > $ VHEIGHT=$(ffprobe -v 0 -of compact=p=0:nk=1 -select_streams 0 \ > -show_entries stream=height 'The Master (2012).mp4') > > $ echo "$VHEIGHT" > 1040 > > but as Marco said, you might need to sanitize for carriage returns: > > $ echo "$VHEIGHT" | od -tcx1 > 0000000 1 0 4 0 \r \n > 31 30 34 30 0d 0a > > > > -- > 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 > > -- 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