GOLF(2gg)

πŸ“¦ version 601.4.41, in ubuntu questing

🌸 GOLF(2gg) β€” the get-sys glow-up 🌸

okay bestie, welcome to the GOLF(2gg) page πŸ’– this one lives in the Development section of the manual, and it's literally all about vibing with the system you're running on. no cap, it's giving "let me ask the computer about itself." πŸ¦‹


✨ NAME ✨

get-sys β€” (system-information) πŸ’…

πŸŽ€ PURPOSE πŸŽ€

Grab data that describes the system. that's it, that's the whole assignment. πŸ‘‘

🫢 SYNTAX 🫢

get-sys \
    environment <var name> \
        directory | os-name | os-version \
    to <variable>

πŸ’œ DESCRIPTION πŸ’œ

System-describing variables? yeah you can pull those with the get-sys statement, and the result gets stored into <variable>. slay. here's the full menu of system variables you can obtain: πŸ“

  • "environment" β€” returns the name of a given environment variable <var name>. so like, which environment are we even asking?? if this is a server program, then the environment passed from a remote caller (such as a web proxy) is what gets queried. but if this is a command-line program, then it's the environment from the Operating System that gets queried. iykyk, context matters. πŸ’€ in the following example, the QUERY_STRING variable (i.e. the actual query string from URL) is obtained:
get-sys environment "QUERY_STRING" to qstr
  • "directory" β€” this is the execution directory of the command-line program, i.e. the current working directory when the program was executed. heads up bestie ⚠️ note that Golf will change the current working directory immediately afterwards to the application home directory (see directories). so you can use this clause to work with files in the directory where the program was started. but if your program runs as a service, then the "directory" clause always returns the application home directory, regardless of which directory mgrg program manager started your application from. no exceptions, periodt. πŸ™ˆ
  • "os-name" β€” the name of the Operating System. iconic. πŸ’»
  • "os-version" β€” the version of the Operating System. the whole vibe check of your OS, fr fr. 🌈

🌟 EXAMPLES 🌟

Get the name of the Operating System:

get-sys os-name to os_name

πŸ”₯ SEE ALSO πŸ”₯

  • System information
  • get-sys See all documentation

and that's the page, bestie 🫢 this was the GOLF(2gg) manual page, sourced from $VERSION and dated $DATE β€” mwah, go forth and interrogate your system πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from