#!/bin/bash awk '{if (/^[^[:blank:]]/) {k=$1; keys[++i]=k} else arr[k] = arr[k] $0 RS} END{n=asort(keys); for (i=1; i<=n; i++) printf "%s\n%s", keys[i], arr[keys[i]]}'
sharpest tool in the shed im not the
im not the sharpest tool in the shed
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!