delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2017/10/01/02:41:16

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:to:from:subject:message-id:date:mime-version
:content-type:content-transfer-encoding; q=dns; s=default; b=ZyQ
mq3xLpeOzLdB4814grOGbsWwzwRMdBV56J5W3Y7sWtVhaVKBzZcCyAx3aDcjU9Hf
GpkR+vngkjeOnb7lfSwVGLHBZpymXsuWijzA/sLgqxjurh3ZQNZYTeirdVJb5idp
PrK/BU0m6xw7PQtMIgp7iIJ0hm8G1LGgS9/6OgMc=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:to:from:subject:message-id:date:mime-version
:content-type:content-transfer-encoding; s=default; bh=5UfrtKTnr
QBpcQDE/i2zBkq0eVM=; b=CnwOWJk8SP2q+D58lFyynCRlFfHx0+GZsgQKgbSRo
7mPEREHSjixSMnGiX1KgXDNhscDOjmNbc3fIeu9vSqK9j5XGLnLNxHRog5+Sr6D7
ZmqzxH/xXQi9JzYrTpEnaOvYDjhRbYPI/ac9qcewXOgxjT+WtD/mzovH1jvOTMNS
Kk=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-0.0 required=5.0 tests=BAYES_40,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=H*F:D*hu, H*Ad:D*hu, works!, crop
X-HELO: mail2.informatik.hu
To: cygwin AT cygwin DOT com
From: Vukovics Mihaly <vm AT informatik DOT hu>
Subject: bash command substitution
Message-ID: <8f69ce8f-1092-abdb-e19d-85018ef0c260@informatik.hu>
Date: Sun, 1 Oct 2017 08:40:51 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0
MIME-Version: 1.0
X-IsSubscribed: yes
Note-from-DJ: This may be spam

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?


-
Köszönettel:
Vukovics Mihály


--
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019