#!/bin/bash echo "Enter names separated by comma:" read input echo "$input" | tr -d ',' | tr ' ' '\n' | \ awk '{ print toupper(substr($0,1,1)) tolower(substr($0,2)) }' | \ sort | uniq -c | \ awk '{print $2, $1}'