public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Wouter van Doorn <wouter@vandoorn.tv>
To: cygwin@cygwin.com
Subject: Re: bash command substitution
Date: Sun, 01 Oct 2017 17:16:00 -0000	[thread overview]
Message-ID: <CANZ2p_eMARdbhRxS9j0D2GFMb71n-B+k2Z9dTOQ8bcNKguwDnw@mail.gmail.com> (raw)
In-Reply-To: <59d11f4f.3b189d0a.39b5f.144a@mx.google.com>

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 <svnpenn@gmail.com> 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

  reply	other threads:[~2017-10-01 17:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-01  6:40 Vukovics Mihaly
2017-10-01  8:19 ` Marco Atzeri
2017-10-01 17:01 ` Steven Penny
2017-10-01 17:16   ` Wouter van Doorn [this message]
2017-10-01 17:54 ` Brian Inglis
2017-10-02 12:23   ` Vukovics Mihály

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=CANZ2p_eMARdbhRxS9j0D2GFMb71n-B+k2Z9dTOQ8bcNKguwDnw@mail.gmail.com \
    --to=wouter@vandoorn.tv \
    --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).