Rand Stats



Actions Status Actions Status Actions Status


QueryOS - Provides a class and an executable, query-os, to list OS details


use QueryOS;
my $o = OS.new;
say $o.version-name # OUTPUT: «debian␤»


QueryOS is a module that provides a class, OS, with methods and attributes to simplify module authors' porting their work to various operating systems by identifying important system discriminators. The module relies on the attributes of Raku's $*USER, $*DISTRO, and $*KERNEL variables and parses out additional details in parts of those attributes.

Current attributes and methods are:

List of known DISTRO names:

Example binary use

When I execute query-os q on my system I get:

This program is currently running on:

    Host:           bigtom
    User:           tbrowde
    Distro:         debian*
    Version name:   bullseye
    Version number: 11
    System:         x86_64

This module provides class 'OS' whose attributes
provide details of the system to aid module
authors porting to multiple versions. See the
README for more information or use the 'list'
option to this program.

*NOTE: If the 'Distro' name is not recognized,
       it will be so stated in parentheses
       following the reported name.


Tom Browder tbrowder@acm.org


© 2023-2024 Tom Browder

This library is free software; you may redistribute it or modify it under the Artistic License 2.0.