Skip to content

Instantly share code, notes, and snippets.

@haridutt12
Last active October 22, 2018 17:48
Show Gist options
  • Save haridutt12/4ca0dab9149bd57c054fd6ef662c25c5 to your computer and use it in GitHub Desktop.
Save haridutt12/4ca0dab9149bd57c054fd6ef662c25c5 to your computer and use it in GitHub Desktop.
#!/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