Re: awk help needed

Go to solution
Elmar P. Kolkman
Honored Contributor

Re: awk help needed

BTW, Andrew, make sure you keep a good point assignment ratio, you can assign zero points to all my recent replies... They have nothing to do with the question, I just like discussions like this with Merijn ;-)
Every problem has at least one solution. Only some solutions are harder to find.
Honored Contributor

Re: awk help needed

kolkman, we can use (merjin's command :)) pr with some width settings to get it to view the long file name's effectively as,

It is good to change the size of -15s to -21s to get long files in a good format as,

#ls | awk '{ printf "%-21s",$0 ; if ((NR % 6) == 0) { printf "\n";}} END {printf "\n"}'

We can get this with the following pr as,

# ls | pr -t -w125 -c 6

And some more options as,
-ock, etc.. They are good to make this easily.

But ls ordering is lost on piping there when do awk / pr itself.

Easy to suggest when don't know about the problem!