I need to get desired output using a shell script.
Command should print number of occurrence of each alphabet only when it's greater than 1, i.e
aaab should come as
I tried with below commands and they didn't work for me, as I have to pass characters manually to my command.
echo "aaabbcaaabbcc" | grep -o a echo "aaabbcaaabbcc" | uniq -c echo "aaabbcaaabbcc" | grep -o a | uniq -c
I am unable to find how I can split it character-wise and then check number of occurrences.