Last active
February 12, 2021 14:03
-
-
Save n1lux/b5d8bea0009e2dec4aa54ca1ca82e832 to your computer and use it in GitHub Desktop.
Bash-tips
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Count word occurrences in file | |
grep -wo '[[:alnum:]]\+' filename | sort | uniq -cd | |
# Iter over sum of a word occurence, get first column (awk print$1) and store sum in variable $sum | |
for i in $(grep -wo '[[:alnum:]]\+' alunos_atualizaram.txt | sort | uniq -cd| awk '{print $1}'); do sim=`expr $sum + $i`; done | |
echo $sum |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment