# Integration: a word-frequency report built from shell, sed, tr and sort. cat >text <<'TXT' The quick brown fox jumps over the lazy dog. The dog barks; the fox runs. A quick, quick fox! TXT normalize() { # tr's ranges and -c follow the code page's collating order, which on # z/OS (EBCDIC) makes 'A-Z' 'a-z' a mapping into punctuation and # leaves ';' alone. sed and the [:upper:]/[:lower:] classes do not. sed 's/[^a-zA-Z]/ /g' | tr '[:upper:]' '[:lower:]' | tr -s ' ' '\n' | sed '/^$/d' } total=0 while read -r w; do total=$((total + 1)) done <