[Gambas-user] getting Gambas version info across devices

Bruce adamnt42 at gmail.com
Thu Mar 25 21:37:19 CET 2021


On 26/3/21 3:07 am, Bruce Steers wrote:
> ELF could work i think as i have readelf command.
> 
> but a bit of a needle in a haystack. Not sure where to look for the
> version/trunk info.
> 
> 
> Best i have come up with is this terrible awful , almost disgraceful hack
> using the command strings.
> "terrible but it works" ;)
> 
>      Dim sCli, sVer As String
> 
>          Shell "strings " & sDrive &/ "usr/bin/gbc3 | grep '3.'" Wait To sCli
>          Dim sVar As String[] = Split(sCli, "\n")
>          Dim c As Integer = sVar.Find("gbc3: start task: [%d] '%s'")
>          While Left(sVer, 2) <> "3." And c < sVar2.Count
>          Inc c
>          sVer = sVar2[c]
>          Wend
> 
> Hack , some might say.
> Luck , could also be true.
> 
> whatever you cal it i'm now 10 out of 10 on getting it right ,,,, wrongly
> ;) lol
> 
> 
> But the ELF way looks to be the way if only you know what to look for (and
> i don't :( )
> 
> BruceS
> 

Urrgh, Yes, Sort of "If it looks a bit like a duck then it must be a 
duck, so shoot it." :-)

maybe
Shell "strings " & sDrive &/ "usr/bin/gbc3 | grep '3\.[0-9]'" Wait To sCli
might lower the risk.

b


More information about the User mailing list