NAME
Sys::OsRelease - Read OS info from system os-release file
SYNOPSIS
use Sys::OsRelease;
my %osinfo = os-release;
DESCRIPTION
Sys::OsRelease is a module that provides the os-release
function, which reads your system's os-release file and returns a hash of the data found in the file.
The os-release file is a text file found on many modern *NIX systems that conveniently details operating system identification data, such as the OS name and version. More information can be found in the official standard by freedesktop.org.
By default, os-release
will try to locate and read one of the following files in descending order of priority:
/etc/os-release
/usr/lib/os-release
os-release
's signature:
Str :$path = get_os-release_path(),
Bool :$defaults = False,
Bool :$strict = True,
Bool :$standard-only = True,
path
Path to the os-release file.
By default, searches for os-release file in the standard locations which were mentioned above.
defaults
Initialize hash with default values, which are the following:
NAME => "Linux",
ID => "linux",
PRETTY_NAME => "Linux",
SYSEXT_SCOPE => "system portable",
Defaults to False
.
strict
Toggle strict file reading. When True
, os-release
will do basic sanity checks on read data and die on invalid lines. When False
, os-release
will just ignore invalid lines and odd data.
Defaults to True
.
standard-only
Determines whether os-release
should ignore non-standard parameters (those not listed in the official freedesktop.org standard).
Defaults to True
.
AUTHOR
Written by Samuel Young, samyoung12788@gmail.com.
COPYRIGHT
Copyright 2024, Samuel Young
This program is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0.
SEE ALSO
os-release