-
./EXAMINEfiles/00_1file_LineLENGTHS-Summary_awk.sh.txt
This script contains an 'awk' program that reads a (text) file and shows
a summary at the end of reading the file. The summary shows the
max and min line lengths --- and number of records read --- and average
number of characters per record.
The 'awk' program uses 'BEGIN' and 'END' sections in addition to the 'body' section.
-
./EXAMINEfiles/00_1file_LineLENGTHS_awk.sh.txt
This script contains an 'awk' program that reads a (text) file and shows
the length of each line --- with a summary at the end that shows the
max and min line lengths --- and number of records read --- and average
number of characters per record.
Uses 'BEGIN' and 'END' sections in addition to the 'body' section.
NOTE: On huge files, this could generate a long list of record lengths.
-
./EXAMINEfiles/04a_1file_SHOW-STR-MATCH-LINES_awk.sh.txt
This script contains a *MANY-LINE* 'awk' program that reads a (text) file
and shows the lines that contain a user-specified string (or strings).
Multiple-strings can be user-specified by separating the multiple strings by
vertical-bars (|) --- like the 'egrep' command.
The output shows PLUS-OR-MINUS N lines before and after each 'match-line',
where N is hard-coded to 4.
Three '-v' options are used to pass 3 parameters to the awk program.
This awk program uses such items as 'BEGIN', 'for ( i = 1 ; i <= N ; i++ )',
a array 'prev[i]', 'if', '==', 'toupper', 'split', 'index', '!=',
'printf', 'print', 'for ( i = N ; i > 0 ; i-- )', '&&', and 'END'.
This 'SHOW-STR-MATCH-LINES' script shows quite a useful variety of
'awk' processing options.
-
./EXAMINEfiles/04b_1file_SHOW-RANGE-OF-LINES_awk.sh.txt
Two '-v' options are used to pass 2 parameters to the awk program ---
a 'start' line number and an 'end' line number.
This awk program uses such items as 'BEGIN', '+=', 'if', '>=', '&&',
'<=', 'print', 'exit', 'END', 'printf'.
-
./FINDlists/05_anyfile4Dir_findFILES-BIGGERthanNmeg_allLEVS_ find-f-size-ls-sort-awk.sh.txt
This script pipes output from 'find' and 'ls' through 'sort and into 'awk'.
The awk program uses such items as 'BEGIN', 'index', '=', 'printf',
'substr', '+', and 'END' to print a column of floating-points numbers
along with some columns of strings.
-
./FINDlists_TEST/.findANDshow_strings1and2_over2linesINfile_ awk.sh.txt
This script uses 4 '-v' options to pass 4 parameters to the awk program ---
This awk program uses such items as 'BEGIN', 'if', '==', 'toupper', 'index',
'getline', 'printf'.
This script uses 'getline' to get 2nd lines in the process of finding the match
lines in the file which contain a match to the string1 in the
1st of a pair of successive lines and string2 in the 2nd line of
the pair of lines.
-
./FINDlists_TEST/05_1file_findSTRover2lines_ awk.sh.txt
This script passes a single filename to the 'hidden' script
'.findANDshow_strings1and2_over2linesINfile_awk' above.
-
./FINDlists_TEST/05_anyfile4Dir_findSTRover2lines_ in_dirMASKFILS_1LEV_awk.sh.txt
This script uses 'find' with '-maxdepth 1' to pipe filenames into the 'hidden' script
'.findANDshow_strings1and2_over2linesINfile_awk' above.
-
./FINDlists_TEST/05_anyfile4Dir_findSTRover2lines_ in_dirMASKFILS_allLEVS_awk.sh.txt
This script uses 'find' to pipe filenames into the 'hidden' script
'.findANDshow_strings1and2_over2linesINfile_awk' above.
-
./MAPtools/10_oneSVGfile_EXTRACTpath-etcXYdata_ egrep-fold-awk-sed-txteditor.sh.txt
This script uses the 'fold' command to pipe the shortened (folded) lines
of an SVG file into an awk command.
This awk program uses such items as 'BEGIN', '=', 'if', '==', 'index',
'print', 'next', 'else', '!='.
The output from the awk program is piped through about 35 'sed' substitution
commands and a final 'fold' command.
-
./SPACElists/00_anyfile_SPACE-in-FILESYSTEMS_ df-k-awk.sh.txt
This script pipes the output from 'df -k' through a simple 'sed' command and
a 'sort' command into the 'awk' command'.
The awk command processes a single 'printf' statement that uses some simple
arithmetic to calculate some 3 columns of numbers and prints out the three
columns of numbers along with several columns of strings.
-
./SPACElists/01a_anyfile4Dir_SPACE-USEDby-SUBDIRS_nLEVS_ SIZEsort_find-d-maxdepth-du-s-awk.sh.txt
This script uses the 'find' command and the 'du -k' command piped through
a 'sort' command into the 'awk' command.
The 'awk' command processes a simple 2-line program that uses 'index' and 'substr' and
'printf' and some simple arithmetic to printout two columns. One column is
a floating-point number and the other column is a string.
-
./SPACElists/01b_anyfile4Dir_SPACE-USEDby-SUBDIRS_allLEVS_ SIZEsort_du-awk.sh.txt
This script uses the 'du -k' command piped through
a 'sort' command into the 'awk' command.
The 'awk' command processes a simple 2-line program that uses 'index' and 'substr' and
'printf' and some simple arithmetic to printout two columns. One column is
a floating-point number and the other column is a string.
-
./SPACElists/03_anyfile4Dir_SPACE-USED-by-FILES_1LEV_ SIZEsort_ls-awk.sh.txt
This script uses the output of an 'ls -la' command piped through simple 'sed' and
'grep' and 'sort' commands into the 'awk' command.
The 'awk' command processes a simple 2-line program that uses 'index' and 'substr' and
'printf' and some simple arithmetic to printout seven columns. One column is
a floating-point number and the other 6 columns are strings.
-
./SPACElists/04_anyfile4Dir_SPACE-USEDby-FILES_1LEV_ AGEsort_ls-awk.sh.txt
This script uses the output of an 'ls -latr' command piped through simple 'sed' and
'grep' commands into the 'awk' command.
The 'awk' command processes a simple 2-line program that uses 'index' and 'substr' and
'printf' and some simple arithmetic to printout seven columns. One column is
a floating-point number and the other 6 columns are strings.
-
./SPACElists/05a_anyfile4Dir_SPACE-USEDby-FILES_allLEVS_ SIZEsort_find-ls-awk.sh.txt
This script uses the output of 'find' and 'ls -l' commands piped through a simple
'sort' command into the 'awk' command.
The 'awk' command processes a simple 2-line program that uses 'index' and 'substr' and
'printf' to printout three columns that are strings. That output is piped into a 'sort'.
-
./SPACElists/05b_anyfile4Dir_SPACE-USEDby-BIGGESTfiles_ allLEVS_find-ls-awk.sh.txt
This script uses the output of 'find' and 'ls -l' commands piped through a simple
'sort' command into the 'awk' command. The 'find' command uses a '-size' option.
The 'awk' command processes a simple 2-line program that uses 'index' and 'substr' and
'printf' and some simple arithmetic to printout seven columns. One column is
a floating-point number and the other 6 columns are strings.
-
./SPACElists/06_anyfile4Dir_COUNT-FILESinSUBDIRS_allLEVS_ find-d-ls-grep-wc-awk.sh.txt
This script uses the 'find' command with the '-type d' option and an '-exec' option to run
a 'hidden' script named '.filecnt_4dir_1level_2stdout.sh' on each directory found.
The output is piped into an 'awk' command.
The 'awk' command processes a simple 2-line program that uses 'index' and 'substr' and
'printf' and some simple arithmetic to printout seven columns. One column is
a floating-point number and the other 6 columns are strings.
-
./SPAMEXAMtools/00a_1mailFolderFile_COUNT-Emails_ awk.sh.txt
This script feeds a mail-folder-file into an 'awk' program about 7 lines long.
The 'awk' program uses 'BEGIN', '=', 'if', '~' (for matching a simple regular expression),
'END' and 'printf'. The 'END' section prints out a count of the number
of emails in the 'folder file', which were counted by finding 'From' lines.
-
./SPAMEXAMtools/01a_1mailFolderFile_SHOW_FROM-IPaddressLINES_ awk.sh.txt
This script feeds a mail-folder-file into an 'awk' program about 22 lines long.
The 'awk' program uses 'BEGIN', '=', 'if', '~' (for matching a simple regular expression),
'index', 'substr', '!=', 'END' and 'print'.
This awk program prints out at least 2 lines from each email --- 'From -' and 'Received: from' lines.
The 'Received' lines may contain IP addresses of mail servers.
'Date:' and 'Subject:' lines are also printed.
-
./SPAMEXAMtools/01b_1mailFolderFile_SHOW_FROM-IPaddresses_ awk.sh.txt
This script feeds a mail-folder-file into an 'awk' program about 22 lines long.
The 'awk' program uses 'BEGIN', '=', 'if', '~' (for matching a simple regular expression),
'index', 'substr', '!=', 'END' and 'print'.
This awk program prints out at least 2 lines from each email --- 'From -' and at least
one IP address extracted from a 'Received: from' line.
'Date:' and 'Subject:' lines are also printed.
-
./SPAMEXAMtools/01c_1mailFolderFile_SHOW_ALL-IPaddressLINES_ awk.sh.txt
This script feeds a mail-folder-file into an 'awk' program about two lines long.
The 'awk' program uses 'if' and '~' (for matching a simple regular expression),
along with 'print'.
This awk program prints out all 'From -' and 'Received: from' lines --- to show
essentially all IP addresses in the folder file.
-
./SPAMEXAMtools/01d_1mailFolderFile_SHOW_All-HEADERlines_ awk.sh.txt
This script feeds a mail-folder-file into an 'awk' program about seven lines long.
The 'awk' program uses 'if' and '~' (for matching a simple regular expression),
along with 'print'.
This awk program prints out all lines containing:
- 'From - '
- 'Return-Path: '
- 'Received: from '
- 'From: '
- 'To:'
- 'Subject:'
- 'Date:'
to show all mail 'header' lines in the folder file.
-
./USER-GROUPtools/00_anyfil_SHOW-GROUPS_Names-Numbers-and-their-Users_ etc-groups-awk-sort.sh.txt
Uses a one-line 'awk' program on the '/etc/groups' file to printout
columns 1, 3, and 4 (which were separated by a colon character) in nice, aligned columns.
The output is piped into a 'sort' command.
-
./XWINCOLORtools/00_anyfile_SHOW-XCOLORS-BRIGHTNESSorRorGorB-SORTED_ showrgb-grep-awk-sort.sh.txt
This script pipes the output of the 'showrgb' program through simple 'tr', 'grep',
'sort' and 'uniq' commands and then into two 'awk' programs.
The first 'awk' program is about ten lines long and uses 'BEGIN', '=',
'if', '==', 'next', and 'print'.
The second 'awk' program is 2 lines long and uses 'index', 'substr', and
'printf' along with some simple arithmetic.
The final output is piped through a 'sort' command. The type of 'sort' is
specified by the user from about 13 sort options offered by a 'zenity' GUI prompt.
-
./XWINCOLORtools/00_anyfile_SHOW-XCOLORS-MORE-RorGorB-SORTED_ showrgb-grep-awk-sort.sh.txt
This script pipes the output of the 'showrgb' program through simple 'tr', 'grep',
'sort' and 'uniq' commands and then into two 'awk' programs.
The first 'awk' program is about ten lines long and uses 'BEGIN', '=',
'if', '==', 'next', and 'print'.
The second 'awk' program is actually a choice from 6 different 2-line awk programs
that use 'if', '<=', '&&', '>=', and 'print'.
The final output is piped through a 'sort' command.
The type of 2nd-awk-program and the type of 'sort' is specified by the user
from 6 R-G-B select-and-sort options offered by a 'zenity' GUI prompt.
-
./XWINCOLORtools/00_anyfile_SHOW-XCOLORS-NEAR-RGB_ showrgb-grep-nawk-sort.sh.txt
This script pipes the output of the 'showrgb' program through simple 'tr', 'grep',
'sort' and 'uniq' commands and then into one 'awk' program.
The 'awk' program is about seven lines long and uses '=', subraction,
'sqrt', multiplication, addition, 'index', 'subsrt', and 'printf'
to print out 8 columns of numbers and names.