From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 37945 invoked by alias); 1 Oct 2017 08:19:46 -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 37711 invoked by uid 89); 1 Oct 2017 08:19:45 -0000 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 Received: from mail-wm0-f43.google.com (HELO mail-wm0-f43.google.com) (74.125.82.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 01 Oct 2017 08:19:44 +0000 Received: by mail-wm0-f43.google.com with SMTP id i131so5496504wma.0 for ; Sun, 01 Oct 2017 01:19:43 -0700 (PDT) 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) Received: from [192.168.2.108] (pD9ED573B.dip0.t-ipconnect.de. [217.237.87.59]) by smtp.googlemail.com with ESMTPSA id m21sm6919546edb.88.2017.10.01.01.19.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 01 Oct 2017 01:19:40 -0700 (PDT) Subject: Re: bash command substitution To: cygwin@cygwin.com References: <8f69ce8f-1092-abdb-e19d-85018ef0c260@informatik.hu> From: Marco Atzeri Message-ID: <3efb3dc0-4364-8d48-c140-0bdfad33ca0a@gmail.com> Date: Sun, 01 Oct 2017 08:19:00 -0000 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> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2017-10/txt/msg00001.txt.bz2 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