On Wed, 8 Dec 2010 06:35:06 -0500, Richard Hipp <[email protected]>
wrote:
>The version is still 3.7.4. It is merely encoded as 3070400 in the
>filename, since names like 3070400, 3070403, 3070420, 3070500, 3071200
>sort into correct order when you do "ls", but the corresponding real
>version numbers 3.7.4, 3.7.4.1, 3.7.4.20, and 3.7.12 do not.
For anyone who needs it, here's a quick and dirty converter:
#!/usr/bin/ksh93
#
# convert numeric version into
# version.revision.release.dotrelease
# vrrlldd -> v.r.l.d
#
# e.g. 3070400 -> 3.7.4.0
# 3071201 -> 3.7.12.1
#
# Written 2010 for fun by Kees Nuyt, NL
# No copyright, use as you wish
#
## funcs
#
function convert {
if [ "$1" = "" ] ; then return; fi
p="$1"
v=${p:0:1}
r=${p:1:2}
l=${p:3:2}
d=${p:5:2}
# remove this demo output to stderr
printf "%s is %d.%d.%d.%d\n" "$p" "$v" "$r" "$l" "$d" >&2
# output "the unix way" to stdout
printf "%d.%d.%d.%d\n" "$v" "$r" "$l" "$d"
}
#
## MAIN
#
# Two demos and the real thing
convert 3070400 # remove this demo
convert 3071201 # remove this demo
convert $1
--
( Kees Nuyt
)
c[_]
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users