.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. .TH SPC "1" "January 2020" "spc 0.5.7" "User Commands" .SH NAME spc \- colorize and print to standard output .SH SYNOPSIS .B spc [\fIOPTION\fR] [\-c file|\-C directory] [\-t type] [\fIFILE\fR]... .SH DESCRIPTION .\" Add any additional description here .PP Colorize specific patterns in the input and write to standard output. The output may optionally be formatted as a web page. .TP \fB\-c \fB\ | \fB\-\-config=FILE\fR specify non-standard config file .TP \fB\-C \fB\ | \fB\-\-config\-dir=DIR\fR specify non-standard config file directory .TP \fB\-d \fB\ | \fB\-\-debug\fR turn on debug information (multi-level \-d \-d ...) .TP \fB\-D \fB\ | \fB\-\-no\-extension\fR don't look at ./.spcrc[\-ext] for config file .TP \fB\-h \fB\ | \fB\-\-help\fR display this help and exit .TP \fB\-m \fB\ | \fB\-\-matching\fR print only lines that have matches .TP \fB\-n \fB\ | \fB\-\-line\-numbers\fR precede each line with a line number .TP \fB\-r \fB\ | \fB\-\-reverse\fR reverse black and white .TP \fB\-R \fB\ | \fB\-\-nohomedir\fR dont look in ~/.spcrc for config files .TP \fB\-S \fB\ | \fB\-\-printsysdir\fR print SYSTEM_DIRECTORY and exit .TP \fB\-t \fB\ | \fB\-\-type=TYPE\fR specify the effective file type or extension .TP \fB\-v \fB\ | \fB\-\-version\fR output version information and exit .TP \fB\-w \fB\ | \fB\-\-webpage\fR generate web page .PP With no FILE read standard input. .SH CONFIGURATION FILE SEARCH .br Configuration files are required for proper operation. These files are found by searching in a number of locations until a proper one is found. The directories and file names are searched in the following order for a file with the extension ".foo" or if the "\-t foo" option is used. Also, if the "\-C bar" option is used it's place in the search is shown. \./.spcrc-foo \./.spcrc ~/.spcrc/spcrc-foo ~/.spcrc/spcrc bar/spcrc-foo bar/spcrc SYSTEM_DIRECTORY/spcrc-foo SYSTEM_DIRECTORY/spcrc The file extension is obtained by using the characters after the final '.' character in the file name. If there is no extension then the filename itself is used. However, if the extension is "log" then additional processing is done. The filename, i.e. the part of the path after the last '/' character, is used up to the first '.' character. For example, this results in an extension of "apache" for an apache log with the name "apache.0.log". This behavior can be over-ridden using the \-t option. .SH CONFIGURATION FILE FORMAT .br SuperCat configuration files have a fixed columnar format for readability and easy parsing. There are 6 fields per line although only 2-3 require entries. The format is: .nf 1 2 3 4 5 1234567890123456789012345678901234567890123456789012345 HTML Color Name Col A N T RE / String / Characters #################### ### # # # ######################## .TP \fBHTML Color Name\fR (columns 1-20) This optional field specifies the standard HTML color name to use when creating a web page. It is only required if the \-w option of Supercat is used. .TP \fBCol\fR - Color (columns 22-24) This is the mandatory three character color name which may take on one of the values: blk, red, grn, yel, blu, mag, cya or whi. .TP \fBA\fR - Color Attribute (column 26) This is a color attribute which may take on one of the following values: '-':normal, 'b':bold, 'u':underline, 'r':reverse or 'k':blink. A space ' ' defaults to '-':normal. .TP \fBN\fR - Number of matches to color (column 28) This is a single digit number that indicates the number of matches to color on a single line. '0' indicates all. A space ' ' defaults to '0':all. .TP \fBT\fR - Type of Match (column 30) This is a single character which may take on the following values: r : regular expression R : regular expression (case-insensitive) s : string c : characters t : unix time conversion RE (MMDDHHMMSS) T : unix time conversion RE (YYMMDDHHMM) u : unix time conversion RE ( HH:MM:SS) U : unix time conversion RE (YYYY:MM:DD) A space ' ' defaults to 'r':RE. An extended regular expression (see regex(7)) specifies the pattern to match and the pattern or sub-pattern(s) to color. The portions of the pattern in parentheses are colored. The string matches the exact string and colors it. For the list of characters, each character is matched individually and colored. The time RE extended regular expression specifies a pattern to match with one sub-pattern to color of the form ([0-9]{10}). This should match a 10 decimal digit Unix seconds since 01/01/1970. This number will be converted to the human readable form: MMDDHHMMSS or YYMMDDHHMM replacing the same 10 columns. .TP \fBRE / String / Characters\fR - Attribute (columns 32-) .SH COMMAND LINE EXAMPLES .TP spc spc.c Colorize file spc.c. .TP cat spc.c | spc \-t c Read standard input formatting type C file to standard output. .SH CONFIGURATION FILE EXAMPLES Take a look at some of the configuration files delivered with SuperCat that can be found in the SYSTEM_DIRECTORY. The following are a few simple examples of the syntax of the configuration file. .TP Magenta mag - 0 r ([0-9]{2}):([0-9]{2}):([0-9]{2}) Color a time field HH:MM:SS but not the colons. .TP Cyan cya t ^([0-9]{10}) Match a 10 decimal digit number at the beginning of a line treating it as a Unix seconds since epoch and convert it to MMDDHHMMSS in cyan. .TP Cyan cya 1 t ([0-9]{10}) Similar to above but using numeric count. .TP Yellow yel "(.*)" Color quoted string in yellow. .SH AUTHORS Written by Mark P Anderson and Thomas G Anderson. Tested by David B Anderson. Maintained by Thomas G Anderson. .SH "REPORTING BUGS" Report bugs to . .SH COPYRIGHT Copyright \(co 2007-2015 Thomas G Anderson .br This is free software. You may redistribute copies of it under the terms of the GNU General Public License . There is NO WARRANTY, to the extent permitted by law.