delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2017/10/01/04:20:10

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:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type
:content-transfer-encoding; q=dns; s=default; b=Auac8tlPZgeb9I1f
VCRdULdlCivCnXBQRhszfKbw7ibWkLLC39nvF4uLoaYO2iVeWBojAP9W+hrXZIXp
qXu3/+C6sxU7iE8+fy8En/xkd4951T2COxd7cyudzuHeqzWzj/R6YhFtOhKKX2Uj
/f25uMsPBw3eeV7iAqKJNuQ+ZSM=
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:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type
:content-transfer-encoding; s=default; bh=PRrTUgkUf49KQvucu0fY6m
95gpM=; b=OReh6jHvmrb32Wh74GauGBpLCYiPs8hU3A1WRg5RnIp8P46Pt/1vS1
GrTdfH5sMwspN8xgejyWCS36n7mbLrVLq67FeoF94MpZcWdEV/EVJr2ONzG0C6jn
Q4BlTmCdd2va8EvTwqizLfL+LUQNnHzh1HlqNeeeA3vEo3comJkIM=
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=-1.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=cygcheck, Mihaly, mihaly, HContent-Transfer-Encoding:8bit
X-HELO: mail-wm0-f43.google.com
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=UZSXm4j3Z5I1hGS6LTtRufDz32Mz7vImoZvs7D2vYBs=; b=I5JSJGvV4O7x7P9JHQYHCXJpyVbPog0wyQBJAMIdfwl13oh02Xuh9FS2AxH+H8yn17 oSQJPUGJmKxOxdyfCP2mSahbs6i/hRrjCbDryE5bJKPQcbIvu+1rRe8NUOxSmu44MI+3 5lQttgSaLsBx+GEMyXNlkpQWBOUOVBjZACq/YC8xckB4Vz54PKy+o6sTI8gNWV9LkNaF Hn27jZC2zBL/1V1p6GfP5zAy5REZVL0Qj0zjlhRcfVB7I+6KJX12q3fg+pEezgTTyVE8 CiKWgvuhMWK7jY02nlcrYKAjspXqxo0ry657cVUTcRHI04crnlp0VR3B2HXzfPmtEBT9 JOCQ==
X-Gm-Message-State: AHPjjUjfBrC9JHtje7oLGbXu5E4w2U/3q5lrzbela+ugN+LnkSZEoko6 6tmys/7Vcu8KP6302xul1MfF0i/t
X-Google-Smtp-Source: AOwi7QBrFFZhJHs4hpMCNrFfNQcJvGEzSbLD2DeEd1H123fxNf5bpJRg93soOyAnVYl/kcWQKG5K3w==
X-Received: by 10.80.146.178 with SMTP id k47mr15775322eda.197.1506845981607; Sun, 01 Oct 2017 01:19:41 -0700 (PDT)
Subject: Re: bash command substitution
To: cygwin AT cygwin DOT com
References: <8f69ce8f-1092-abdb-e19d-85018ef0c260 AT informatik DOT hu>
From: Marco Atzeri <marco DOT atzeri AT gmail DOT com>
Message-ID: <3efb3dc0-4364-8d48-c140-0bdfad33ca0a@gmail.com>
Date: Sun, 1 Oct 2017 10:19:30 +0200
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0
MIME-Version: 1.0
In-Reply-To: <8f69ce8f-1092-abdb-e19d-85018ef0c260@informatik.hu>
X-IsSubscribed: yes
Note-from-DJ: This may be spam

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

- Raw text -


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