The library file textutil.tf
defines several unix-like commands that are particularly convenient when
used with the %| pipe to
redirect their input or output. For all commands that take an optional
handle argument, tfin is used
if handle is omitted.
- /fgrep [-cvi] pattern
- /grep [-cv] pattern
- /egrep [-cvi] pattern
- These commands search tfin for lines
that match the given pattern, and by default prints those lines.
a line must contain pattern to match;
the entire line must match the
glob pattern pattern;
for /egrep, it must match the
regexp pattern pattern.
Note: these commands are not compatible with those defined in the old
library file grep.tf.
- print only the count of matching lines.
- select only non-matching lines.
- ignore case (for /fgrep and /egrep only;
/grep always ignores case).
- /readfile filename
- Reads lines from filename and writes them to
- /writefile [-a] filename
- Reads lines from tfin and writes them
to file filename.
- append to file instead of overwriting.
- /head [-ncount] [handle]
- Reads the first count (default 10) lines from
handle or tfin
and writes them to tfout.
- /wc [-lwc] [handle]
- Reads lines from handle or tfin
and prints the count of lines, space-separated words, and characters
that were read.
- Print the count of lines only.
- Print the count of words only.
- Print the count of characters only.
- /tee handle
- Reads lines from tfin and prints them
to handle and tfout.
- /copyio in out
- Reads lines from handle in and prints them to handle out.
- Copies tfin to
tfout, with adjacent non-blank lines
- Copies tfin to
tfout, with adjacent duplicate lines
Back to index
Back to tf home page
Copyright © 1998 - 1999 Ken Keys