DEV Community

loading...

Discussion on: Daily Challenge #66- Friend List

Collapse
idanarye profile image
Idan Arye
s="Fred:Corwill;Wilfred:Corwill;Barney:Tornbull;Betty:Tornbull;Bjon:Tornbull;Raphael:Corwill;Alfred:Corwill"

echo $s \
    | tr ';' '\n' \
    | awk -F: '{print toupper("("$2":"$1")")}' \
    | sort \
    | paste -sd '' -