make command output more Kik compliant

This commit is contained in:
jacekpoz 2024-10-11 11:55:34 +02:00
parent c054752be7
commit 324ecd76ce
Signed by: poz
SSH key fingerprint: SHA256:JyLeVWE4bF3tDnFeUpUaJsPsNlJyBldDGV/dIKSLyN8
2 changed files with 4 additions and 4 deletions

View file

@ -2,6 +2,6 @@
for word in $(grep -Roh '\w*' "$1" | sort | uniq)
do
echo "current word: $word"
grep -Rw "$word" "$1"
echo "$word:"
grep -Rwn "$word" "$1"
done

View file

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