[Ffmpeg-devel] bash substitutions

Alexander Strasser eclipse7
Mon Dec 19 12:47:59 CET 2005


Hi,

matthieu castet wrote:
> M?ns Rullg?rd wrote:
> >Rich Felker <dalias at aerifal.cx> writes:
> >>>
> >>>you could use on sh :
> >>>${parameter%word}
> >>>${parameter%%word}
> >>>${parameter#word}
> >>>${parameter##word}
> >>>
> >>>Something like ${lavu_version%%.[^.]*} should work
> >>
> >>Or ${lavc_version%.*}
> >>However, is this portable, or is it yet another bashism??
> According to POSIX it should be in sh : 
> http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html
> >
> >
> >Solaris /bin/sh dislikes both.
> >
> But there are maybe no-POSIX compliant sh...

  I disagree that we should follow POSIX here.
It is more portable to use old Bourne-style(?) scripting
and can be done without too much hastle in most cases.
  Mans did you test the backticks version?
IIRC it should work on Solaris /bin/sh.

  Alex (beastd)





More information about the ffmpeg-devel mailing list