Last active
October 22, 2018 17:48
-
-
Save haridutt12/4ca0dab9149bd57c054fd6ef662c25c5 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
declare -A Count | |
echo "hit CTRL-C to stop" | |
echo "enter value of n" | |
read N | |
while [ 1 ] | |
do | |
read input | |
for word in $input | |
do | |
if [[ "$word" =~ ^[[:alnum:]]*$ ]] && [ ${#word} > N ] | |
then $Count["${word,,}"] += 1 | |
fi | |
done | |
for i in "${!Count[@]}" | |
do | |
echo "hello" | |
echo "$i : ${Count[$i]}" | |
done | |
# if $? -gt 128 | |
# then | |
# echo "exit" | |
# break | |
# fi | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment