Get FreeBSD version from Emacs Lisp

Just a quick note to myself…

The following Emacs Lisp snippet was written after skimming through the “alias” examples of the Emacs Wiki about ERC:

(defun freebsd-uname-output ()
  (replace-regexp-in-string "[[:space:]]*\\w+@.*[ \t\n]+$" ""
    (shell-command-to-string "uname -a")))

Its output should look like this:

(freebsd-uname-output)
=> "FreeBSD kobe 8.0-CURRENT FreeBSD 8.0-CURRENT #0: Sun Nov 25 20:35:04 EET 2007"