So I swear a lot here

in the website


#!/bin/bash
# List compiled from:
# Slate: http://goo.gl/vPC4X4
# Wikipedia: http://goo.gl/mdcyT8

swear_words=(
    'shit' 'fuck' 'damn' 'bitch' 'crap' 'dick' 'bitch' 'crap'
    'dick' 'piss' 'pussy' 'fag' 'asshole' 'cock' 'bastard' 'darn'
    'douche' 'slut' 'whore' 'christ' 'jesus' 'arse' 'bloody' 'bollocks'
)

if [[ -f "$1" ]]; then
    echo -e "\t\nCount for swear words in $1:\n\t"
    printf "%-12s %s\n" "Word:" "Count:"
    echo "----------------------"
    for w in "${swear_words[@]}"; do
        n=$(egrep -o -i $w "$1" | wc -w)
        printf "%-12s %s\n" $w $n
    done
else 
    echo "Error: $1 is not a valid file"
    exit 1
fi

exit 0
Word:        Count:
----------------------
shit         1323
fuck         2933
damn         146
bitch        318
crap         475
dick         62
bitch        318
crap         475
dick         62
piss         384
pussy        4
fag          4
asshole      201
cock         362
bastard      160
darn         16
douche       2
slut         0
whore        116
christ       1224
jesus        73
arse         632
bloody       176
bollocks     0


Blog Silence

in me

Run Clare 2019 Race Series

in running

Mark’s Terrible Chili

in me


Your email address will not be published. Required fields are marked *