Created
January 28, 2019 13:11
-
-
Save Cvetomird91/dd838e920ef9445dfa8ff904cf67129f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/bin/bash | |
REGEX='Matches found for \d* Hz'; | |
MATCHES_FILE='matches.txt'; | |
grep -riP "$REGEX" > "$MATCHES_FILE"; | |
cat $MATCHES_FILE | grep -ohP "$REGEX" | grep -oP \\d* > frequencies.txt | |
readarray matches < frequencies.txt | |
rm -f matches.txt frequencies.txt | |
export matches; | |
for i in "${matches[@]}"; do | |
echo $i $(grep -ril $i | wc -l); | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment