piktf Find File Utility
[Notes issued with the release of PIKT 1.17.0pre2, which introduced the new piktf find file utility.]
In the pikt-1.17.0pre1 release notes, we mentioned that
... aside from the usual system monitoring and configuration management functions, the principal PIKT Maintainer [Robert Osterlund] uses PIKT to manage hundreds and hundreds of Web pages across several different Web sites...
In fact, the current Web page count is 378. Mainly for that reason, Robert's PIKT configuration is huge--587 .cfg files in 41 different subdirectories below the PIKT configs directory! It's been very difficult to locate things within that configuration, to say the least. Robert had been using a simple egrep-based shell script for that purpose, but it was not up to the task.
In response to this problem, Michel Blanc has written a new Perl script, piktf, for "pikt find". piktf looks for arbitrary text strings and regular expressions within the PIKT configuration. As you might expect, piktf has all sorts of options. They include:
# piktf -h Usage: piktf -<ilfCcnVGTh> <regexp> Options: -i do case insensitive matches -l do literal matches, ignoring special regexp chars -f list only matching .cfg, .alt, .obj, or prgdir files -C list only files in the configs directory -c print count of matching lines -n print line number of matching lines -V show version -G debug mode -T test mode -h help note : with -n, all matches are reported for a file. without -n, matching files are reported once. -n and -c are mutually exclusive.
(Before he is finished, Michel will also add an option to search file and directory names, not just file contents.)
Look for piktf in the top-level bin directory alongside piktx, rkey, and pikth.
Robert considers this new piktf find file utility to be a godsend. It is surprisingly useful, and is a wonderful addition to the PIKT toolkit. We hope you agree.
For more examples, see Developer's Notes.