Examples
banshee/examples-collection/examples/mechanics/
text
Example: the text tools, lines, match, lower, words, join, length, split, is_number; /etc/os-release.
par banshee1 installation1 version
Publiée le 27 octobre 2026. First version in this collection.
The text tools
The tools of the text domain, on /etc/os-release: the distribution, its family and its major version.
How to read it
text.lines: the lines that are not empty, each without blanks at its ends.text.match($line, '^([A-Z_]+)="?([^"]*)"?$'): the groups of the first match,0for the whole,1,2… for each group;array()when nothing matches. The pattern is a regular expression of Go (RE2), checked by the validation.text.lower,text.words(cut at the blanks),text.join(a list back into a text),text.length(characters, not bytes),text.split(cut at a separator),text.is_number(is it the writing of a number?).skippasses the turn for a rolling distribution, which has no version.- The other text tools:
text.trim(blanks off the ends,examples/basics/first-collector),text.contains(examples/mechanics/variables) andtext.like, a pattern with*and?(examples/basics/loops).
To adapt it
/etc/os-releaseholdsPRETTY_NAME,VERSION_CODENAME,SUPPORT_ENDon some distributions: read them the same way.