Wiki
Download
Manual
Eggs
API
Tests
Bugs
show
edit
history
You can edit this page using
wiki syntax
for markup.
Article contents:
== Outdated egg! This is an egg for CHICKEN 4, the unsupported old release. You're almost certainly looking for [[/eggref/5/awk|the CHICKEN 5 version of this egg]], if it exists. If it does not exist, there may be equivalent functionality provided by another egg; have a look at the [[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:]] == awk [[toc:]] === Description A looping construct for processing input in a way similar to the {{awk}} tool. === Author Originally by Olin Shivers. This implementation has been taken from [[http://docs.plt-scheme.org/mzlib/mzlib_awk.html|PLT Scheme's awk library]] and minimally modified by [[/users/felix winkelmann|felix winkelmann]] to work with CHICKEN. === Requirements None === Documentation See [[http://www.scsh.net/docu/html/man-Z-H-9.html#node_sec_8.2|the SCSH documentation for {{awk}}]]. === Examples Count non-comment lines in Scheme file: <enscript highlight="scheme"> (use awk) (print (awk (read-line) (line) ([nlines 0]) ("^[ \t]*;" nlines) (else (add1 nlines)))) </enscript> Strip blank lines: <enscript highlight="scheme"> (use awk) (awk (read-line) (line) () ("[^ \t]" (print line)) ) </enscript> Compute maximal line length: <enscript highlight="scheme"> (use awk) (print (awk (read-line) (line) ([max-len 0]) (#t (max max-len (string-length line)))) </enscript> Sort /etc/passwd file: <enscript highlight="scheme"> (use awk) (define (read-passwd . port) (let ([line (apply read-line port)]) (if (eof-object? line) (values line #f) (values line (string-split-fields ":" line #:infix))))) (for-each (lambda (entry) (print (cdr entry))) (sort (awk (read-passwd) (line fields) ([ans '()]) (#t (cons (cons (car fields) line) ans)) ) (lambda (x y) (string<? (car x) (car y))))) </enscript> === Changelog * 1.8 Fix license specification in the .meta file * 1.7 Bugfix release thanks to Imran Rafique for the report * 1.6 Updated test script to return proper exit status * 1.4 Improved unit tests * 1.3 Added regex dependency * 1.2 Ported to CHICKEN 4 * 1.1 Adapted to new setup scheme * 1.0 Initial release === License PLT Software Copyright (c) 1995-2002 PLT PLT software is distributed under the GNU Lesser General Public License (LGPL).
Description of your changes:
I would like to authenticate
Authentication
Username:
Password:
Spam control
What do you get when you add 11 to 13?