diff --git a/dotfiles/lib/get_cols.awk b/dotfiles/lib/get_cols.awk old mode 100644 new mode 100755 index 4a26c5c0..ceb3c463 --- a/dotfiles/lib/get_cols.awk +++ b/dotfiles/lib/get_cols.awk @@ -1,15 +1,15 @@ #!/usr/bin/env gawk -f -BEGIN{ +BEGIN { column_count=split(cols,column_numbers," "); } { - for(i=1; i<=column_count; i++) - if(column_numbers[i] < 0) + for(i=1; i<=column_count; i++) { + if(column_numbers[i] < 0) printf "%s", $(NF + 1 + column_numbers[i]) else printf "%s", $column_numbers[i] - if(i <= column_count) - printf "%s", OFS - + printf "%s", OFS + } + printf "%s", ORS }