Any command to get version string like "R1/beta4"?

Hi, I’m working on a cross-platform library to get environment information.

It has a function to get product name and its version of running OS (e.g. “Ubuntu 20.04.6 LTS”.)
On Haiku, it returns “Haiku R1/beta4” using the method from the AboutSystem app.

Now, I want another way to get “R1/beta4” to generate a test case for the function.
Is there any command to do it?

I use WMI commands on windows, sw_vers on mac, and /etc/os-release on Linux.
BSD can use uname, and Solaris has /etc/release.
But on Haiku, I can’t find any commands to do it…

1 Like

uname is also available and gives the hrev number, e.g uname -a or uname -v.

Not sure what it gives you on beta versions though.

image

Edit: There is a very similar question to this here: Getting the haiku version

Maybe?
image

1 Like

Thank you for the reply.

Maybe?
~> catattr -d SYS:PACKAGE /system/lib/libbe.so

Yes! that’s like what I want.
Why didn’t I notice that I can refer libbe.so when I used it in my c++ code already…

(edit)
I found that the version command can read the short_info attribute as it is.

~> version /system/lib/libbe.so
R1/beta4
2 Likes

Ah nice! So much simpler