#!/usr/bin/picolisp /usr/lib/picolisp/lib.l (load "@lib/misc.l") (de soundex (Str) (pack (pad -4 (cons (uppc (char (char Str))) (head 3 (let Last NIL (extract '((C) (and (setq C (case (uppc C) (`(chop "BFPV") "1") (`(chop "CGJKQSXZ") "2") (("D" "T") "3") ("L" "4") (("M" "N") "5") ("R" "6") ) ) (<> Last C) (setq Last C) ) ) (cdr (chop Str)) ) ) ) ) ) ) ) (prin "Lookup user: ") (flush) (let (User (clip (in NIL (line T))) Code (soundex User)) (while (native "@" "getpwent" '(S S I I S S S)) # 'native' only in 64-bits (let Lst @ (when (or (= Code (soundex (car Lst))) (= Code (soundex (get Lst 5)))) (println Lst) ) ) ) ) (bye)