This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: bash command substitution
- From: Steven Penny <svnpenn at gmail dot com>
- To: cygwin at cygwin dot com
- Date: Sun, 01 Oct 2017 10:01:03 -0700 (PDT)
- Subject: Re: bash command substitution
- Authentication-results: sourceware.org; auth=none
- References: <8f69ce8f-1092-abdb-e19d-85018ef0c260@informatik.hu>
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