1. 8
    1. 5

      In other words, I wanted to select columns from the output and have them printed neatly and aligned. Don’t ask me why, I guess it’s just some form of OCD.

      Attention to detail is not OCD. You prefer this type of output because it communicates the results cleanly and so lightens the computational load on your reader, even when that is yourself. Sloppy output increases the work needed to comprehend, and also unnecessarily detracts from the reader’s confidence in your work. Not saying you should paper over bad results with fancy formatting, just that bad formatting is like asking someone to look through a dirty window.

      1. 1

        (Author here) You’re right, of course. The link to “some form of OCD” wasn’t meant as any sort of negative, but I did have a slight wondering in the back of my mind about why I’d not seen this requirement (or practice) often, at least in the context of shell output, in the brief searches I did before embarking on the script.

    2. 5

      It is always nice to see new AWK scripts pop up!

      Here is an alternative for those who want to stick to classic Unix commands

      $ find ~/gh -type | cut -d/ -f5,6,7 | column -s/ -t
      1. 1

        That’s lovely. In fact, I’d started looking at column at the outset of this little adventure, then got completely distracted by the lure of the AWK language, and promptly forgot about everything else. I’ve added an update to the post. Thanks!

    3. 2

      This is a well explained post, way to go. I remember the last post I read on your site being so well thought out as well. I love me some awk. In Python there is PrettyTable which I use often, but for awk and shell in general this is nice.

      1. 1

        Thanks, I appreciate that. I find that explaining things (or trying to) helps me understand, too.

    4. 1

      BTW, since publishing this post, I’ve made a couple of updates, incorporating gioele’s helpful comment and also some great input from the user oh5nxo on /r/commandline. Thanks both!