4 ms·
> sortby Something like this? (But of course made more robust. I'm not really into shell scripting.) t=`mktemp sortby.XXXX` tee $t | "$@" | awk '{ key
by abecedarius 4y ago
> sortby
Something like this? (But of course made more robust. I'm not really into shell scripting.)
t=`mktemp sortby.XXXX`
tee $t | "$@" | awk '{ key = $0; getline <"'$t'"; print key "#" $0; }' |
sort -t'#' -k1 |
cut -d'#' -f2-
rm $t