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