(type egg)
(signature "awk egg")
(timestamp 1612269487)
(sxml ((section 2 "Outdated egg!" (p "This is an egg for CHICKEN 4, the unsupported old release.  You're almost certainly looking for " (int-link "/eggref/5/awk" "the CHICKEN 5 version of this egg") ", if it exists.") (p "If it does not exist, there may be equivalent functionality provided by another egg; have a look at the " (link "https://wiki.call-cc.org/chicken-projects/egg-index-5.html" "egg index") ". Otherwise, please consider porting this egg to the current version of CHICKEN.") (tags "egg") (toc)) (section 2 "awk" (toc) (section 3 "Description" (p "A looping construct for processing input in a way similar to the " (tt "awk") " tool.")) (section 3 "Author" (p "Originally by Olin Shivers. This implementation has been taken from " (link "http://docs.plt-scheme.org/mzlib/mzlib_awk.html" "PLT Scheme's awk library") " and minimally modified by " (int-link "/users/felix winkelmann" "felix winkelmann") " to work with CHICKEN.")) (section 3 "Requirements" (p "None")) (section 3 "Documentation" (p "See " (link "http://www.scsh.net/docu/html/man-Z-H-9.html#node_sec_8.2" ("the SCSH documentation for " (tt "awk"))) ".")) (section 3 "Examples" (p "Count non-comment lines in Scheme file:") (highlight scheme "(use awk)\n\n(print\n  (awk (read-line) (line) ([nlines 0])\n    (\"^[ \\t]*;\" nlines)\n    (else (add1 nlines))))") (p "Strip blank lines:") (highlight scheme "(use awk)\n\n(awk (read-line) (line) ()\n  (\"[^ \\t]\" (print line)) )") (p "Compute maximal line length:") (highlight scheme "(use awk)\n\n(print \n  (awk (read-line) (line) ([max-len 0])\n    (#t (max max-len (string-length line))))") (p "Sort /etc/passwd file:") (highlight scheme "(use awk)\n\n(define (read-passwd . port)\n  (let ([line (apply read-line port)])\n    (if (eof-object? line)\n\t(values line #f)\n\t(values line (string-split-fields \":\" line #:infix)))))\n\n(for-each\n (lambda (entry) (print (cdr entry)))\n (sort\n  (awk (read-passwd) (line fields) ([ans '()])\n    (#t (cons (cons (car fields) line) ans)) ) \n  (lambda (x y) (string<? (car x) (car y)))))")) (section 3 "Changelog" (ul (li "1.8 Fix license specification in the .meta file") (li "1.7 Bugfix release thanks to Imran Rafique for the report") (li "1.6 Updated test script to return proper exit status") (li "1.4 Improved unit tests") (li "1.3 Added regex dependency") (li "1.2 Ported to CHICKEN 4") (li "1.1 Adapted to new setup scheme") (li "1.0 Initial release"))) (section 3 "License" (pre " PLT Software\n Copyright (c) 1995-2002 PLT") (pre " PLT software is distributed under the GNU Lesser General Public\n License (LGPL).")))))
