[Abcde-users] 2.9.1 minor error

Matthias König mk at silverserver.at
Wed Mar 28 20:49:09 BST 2018


On Sat, 24 Mar 2018 18:03:05 -0600
"Alan W. Kerr" <awkerr at aoc.nrao.edu> wrote:

> found one more minor error...
> and, apparently, one that no one has "cared about"... yet.
> 
> at line 3502 is:
> 
> 		FIRSTTRACK=$2
> 		LASTTRACK=$(expr $3 + 0)
> 		UTRACKNUM=$FIRSTTRACK
> 
> line 3502 should be changed to:
> FIRSTTRACK=$(expr $2 + 0)
> 
> This will only be important if ripping a "range of tracks" and that
> range *starts* with track 8 or 9 (ie tracks 9-12) because then the
> FIRSTTRACK will be seen as an "illegal octal value", just like
> LASTTRACK was.
> 
> Alan W. Kerr          awkerr at aoc.nrao.edu          Whee!(tm)
> 
> _______________________________________________
> Abcde-users mailing list
> Abcde-users at lists.einval.com
> https://lists.einval.com/cgi-bin/mailman/listinfo/abcde-users


Just a short note: There is also a solution without the use of the
external command expr. Numbers can be specified in the form
base#number. 08 is an (invalid) octal number. 10#08 is a decimal
number. When using arithmetic expansion:

A="08"; A="$((10#$A))"; echo "$A"


A second option is the use of parameter expansion. This will delete a
leading 0, if there is one:

A="08"; A="${A#0}"; echo "$A"

Of course the second solution will only work for 08 but not for 008.


Matthias König



More information about the Abcde-users mailing list