banshee is under active development: collectors will keep changing, and a version you publish will likely need adjustments. For stable use, wait for version 1.0.0.

Examples

banshee/examples-collection/examples/mechanics/

text

Example: the text tools, lines, match, lower, words, join, length, split, is_number; /etc/os-release.

  • example
  • text
  • tools
  • os-release
  • ssh

by banshee1 installation1 version

v1Latest

Published on October 27, 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, 0 for 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?).
  • skip passes 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) and text.like, a pattern with * and ? (examples/basics/loops).

To adapt it

  • /etc/os-release holds PRETTY_NAME, VERSION_CODENAME, SUPPORT_END on some distributions: read them the same way.