[Ffmpeg-devel] bash substitutions
Måns Rullgård
mru
Sun Dec 18 12:47:16 CET 2005
Rich Felker <dalias at aerifal.cx> writes:
> On Sun, Dec 18, 2005 at 10:43:22AM +0100, matthieu castet wrote:
>> Jacob Meuser wrote:
>> >revision 1.217 of configure added some shell substitutions.
>> >these apparently only work with bash, which is _not_ the /bin/sh
>> >on all systems.
>> >
>> >specifically:
>> >
>> > echo "SPPMAJOR=${lavc_version/.*/}" >> config.mak
>> > echo "LAVCMAJOR=${lavc_version/.*/}" >> config.mak
>> > echo "LAVFMAJOR=${lavf_version/.*/}" >> config.mak
>> > echo "LAVUMAJOR=${lavu_version/.*/}" >> config.mak
>> >
>> >this not work with pdksh, which is the /bin/sh on OpenBSD.
>> >I doubt it works with ash, which is the /bin/sh on NetBSD.
>> >
>> And dash on debian.
>>
>> >I suggest the following patch.
>> >
>>
>> 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??
Solaris /bin/sh dislikes both.
--
M?ns Rullg?rd
mru at inprovide.com
More information about the ffmpeg-devel
mailing list