From: Marco Atzeri <marco.atzeri@gmail.com>
To: cygwin@cygwin.com
Subject: Re: bash command substitution
Date: Sun, 01 Oct 2017 08:19:00 -0000 [thread overview]
Message-ID: <3efb3dc0-4364-8d48-c140-0bdfad33ca0a@gmail.com> (raw)
In-Reply-To: <8f69ce8f-1092-abdb-e19d-85018ef0c260@informatik.hu>
On 01/10/2017 08:40, Vukovics Mihaly wrote:
> Hello All,
>
>
> I just wanted to use my bash script written in Debian 8 in
> cygwin(latest, win10 64bit), but does not work.
> At a specific line there is a command substitution trying to get result
> from ffprobe:
>
> 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?
>
> Code:
>
> ...
> declare -i VHEIGHT
> ffprobe -v error -show_entries stream=width,height -of
> default=noprint_wrappers=1 ${OLDFILE} | grep height | cut -f2 -d'='
> VHEIGHT=$(ffprobe -v error -show_entries stream=width,height -of
> default=noprint_wrappers=1 ${OLDFILE} | grep "height" | cut -f2 -d'=')
> ...
>
> Here is some debug log (set -x):
>
> ....
> + declare -i VHEIGHT
> + ffprobe -v error -show_entries stream=width,height -of
> default=noprint_wrappers=1 P1220312.MP4
> + grep height
> + cut -f2 -d=
> 2160 Â Â Â Â Â Â Â Â Â Â # this woudl be the desired value
> + VHEIGHT=Â Â Â Â Â Â # here the variable is empty!
> + VIDSTABDETECTOPTS=:shakiness=10
> + VIDSTABDETECTOPTS+=:result=P1220312-stab.trf
> + VIDSTABTRANSFORMOPTS+=:crop=keep
>
> ....
>
> The same in Linux bash:
>
> ...
> + declare -i VHEIGHT
> + ffprobe -v error -show_entries stream=width,height -of
> default=noprint_wrappers=1 P1220312.MP4
> + grep height
> + cut -f2 -d=
> 2160
> ++ ffprobe -v error -show_entries stream=width,height -of
> default=noprint_wrappers=1 P1220312.MP4
> ++ grep height
> ++ cut -f2 -d=
> + VHEIGHT=2160 Â Â Â # here is the desired value in the variable!!!
> ...
>
> Any suggestions?
>
from where ffprobe is coming for ?
$ cygcheck -p ffprobe
Found 0 matches for ffprobe
If it is a windows program, may it is due to CRLF emitted instead of LF
--
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
next prev parent reply other threads:[~2017-10-01 8:19 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 [this message]
2017-10-01 17:01 ` Steven Penny
2017-10-01 17:16 ` Wouter van Doorn
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=3efb3dc0-4364-8d48-c140-0bdfad33ca0a@gmail.com \
--to=marco.atzeri@gmail.com \
--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).