Useful Unix stuff by Mike Fleming
I've assembled a collection of scripts and Microfosuc COBOL programs in these pages, plus a C program or two. The file viewers were born of frustration at the viewers that are part of the standard Unix package, the file manager because the benighted company I was working at couldn't cope with the concept of mapping shares into Windows (but it's got plenty more useful stuff), and other things just growed, like Topsy. Many of the scripts require COBOL programs (sources for those are supplied too).
Most things here don't need much explanation - the scripts are pretty self explanatory. For anything complex, I've put a link to details of what it does. The complex stuff generally has help screens as I like to remind myself what things do.
Scripts
- datetoymdhm - converts day, month, and year/time from ls listing to
yyyymmdd hhmm
Script - domail - sends an email. Supply To, Cc, Subject, and text.
Script - fm - run file manager program
Details - fsrch - runs a COBOL file searcher created by genprog (see below)
Script - ft - run file index program on index generated by filetree program
Details - fv - run file view program (replacement for more)
Details - fview - runs a COBOL file viewer created by genprog (see below)
Script - fx - run file index program
Details - genprog - generates COBOL programs to either view file contents by
field or search files by field content. Select...assign and file
definition copy members are used to extract information. Key fields are
used for input in the view programs, and key selection shows the fields
for that key.
Generated programs can link to other file viewer programs, passing key field values across.
The generated programs generally need tidying up after generation but provide a sound basis.
Script
COBOL source - keypresses - generates a file containing the key presses generated by
function keys on the current terminal
Script - lookfor - shows a list of files containing a specified string and
allows them to be selected for viewing with either more or fv
Script - lstocsv - takes an ls listing and reformats it into CSV format
Script - mailfile - mails a file or files to a supplied email address
Script - morefrom - shows a list of files and allows selection for viewing using
more or fv
Script - morefromdir - shows all non-zero-length files in a directory and allows
selection for viewing using more or fv
Script - prev_date - returns date a specified number of days ago from today or
from specified date (dd mm yyyy)
Script - runon - run specified program with current date/time set as specified
by options
Script - showit - show source of a script that's found on $PATH
Script - tarzip - tar and zip up a directory
Script - viewtree - use file viewer to show a tree view of directories
Script - vs - run split view file comparison program
Details
COBOL programs
- colours - shows foreground and background colours
Source - keypress - evaluates key presses
Source - valemail - validates email address
Source