${VERSION%.*} in DETAILS - Was - Re: [Lunar-commits] <moonbase> Twisted: Version bumped to 11.0.0 + DETAILS fixes

Duncan Gibson duncan.gibson at xs4all.nl
Wed Jun 15 13:15:24 CEST 2011


> It's quite simple really. ${parameter%word} would remove first match of
> 'word' from the end of the parameter (string). ${VERSION%.*} means
> remove first occurence of . read from right to left and everything after
> it using '*'. If VERSION is 11.2.3 that would give you '11.2'. If you
> want '11' instead all you need to do is to add another % like: ${VERSION
> %%.*}, this means longest match possible. First match would remove .3,
> the second match .2 (read from right to left ie suffix) there third will
> not match since there's no . in front of 11.

OK, that makes the use of ${VERSION%.*} itself clearer.

I assume that "lin -w" subsitutes its argument for $VERSION when it
tries to download, and that's why $MAJOR gives problems.

/me should read the source

D.



More information about the Lunar-dev mailing list