make outputs even more Kik compliant

This commit is contained in:
jacekpoz 2024-10-13 21:13:20 +02:00
parent 324ecd76ce
commit e4666df358
Signed by: poz
SSH key fingerprint: SHA256:JyLeVWE4bF3tDnFeUpUaJsPsNlJyBldDGV/dIKSLyN8
3 changed files with 4 additions and 4 deletions

View file

@ -1,3 +1,3 @@
#!/usr/bin/env bash
grep -Roh '\w*' "$1" | sort | uniq -c | sort -nr
grep -Roh '\w*' "$1" | sort | uniq -c

View file

@ -2,5 +2,5 @@
for word in $(grep -Roh '\w*' "$1" | sort | uniq)
do
echo "$(grep -lRw "$word" "$1" | wc -l) $word"
done | sort -r
echo "$word: $(grep -lRw "$word" "$1" | wc -l)"
done | sort -n

View file

@ -2,6 +2,6 @@
for word in $(grep -Roh '\w*' "$1" | sort | uniq)
do
occurences=$(grep -REn "($word.*){2}" "$1")
occurences=$(grep -REn ".*\b$word\b.*\b$word\b.*" "$1")
[ -n "$occurences" ] && printf '%s:\n%s\n' "$word" "$occurences"
done