Skip to content

Instantly share code, notes, and snippets.

@fejese
Created July 29, 2015 07:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fejese/1d6696b92961b5cfe0f9 to your computer and use it in GitHub Desktop.
Save fejese/1d6696b92961b5cfe0f9 to your computer and use it in GitHub Desktop.
#!/bin/bash
awk '
FNR==NR {
l = length($0);
if (l > ml) {
ml = l
}
}
FNR!=NR {
while (length(a[FNR]) < ml) {
a[FNR] = a[FNR] " "
}
}
{
a[FNR] = a[FNR] $0
}
END {
for (i = 1; i <= length(a); i++) {
print a[i]
}
}
' \
$1 $2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment