#!/bin/bashawk -F ':' '{ a[++n] = $1; b[n] = $2; if (length($1) > max) max = length($1) } END { for (i=1; i<=n; ++i) printf "%" max "s:%s\n", a[i], b[i] }'
aaa:aaaaaaaa bb:bbb cccccccccccc:cc d:d
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!