How hard is it to AWK it?

I emailed the dude that maintains the mail server today to get me an up to date list of all our mailboxes. Our email gets handled by a 3rd party company so I don’t get access to that box. I get this in my inbox (note I edited the names for obvious reasons):

drwx—— 2 asmith company 4096 Feb 13 02:30 asmith
drwx—— 2 bsmith company 4096 Oct 21 21:14 bsmith
drwx—— 2 csmith company 4096 Dec 18 09:46 csmith

And so on, for several pages. Now, I know what this is. It is:

ls -l /var/mail/ | grep company

But a clerical person is not going to know that. They going to look at me like I’m from space, and ask me what does all of this shit mean, and I just don’t feel like explaining ls syntax to them. So I piped it through awk, and created a nice list of just the names without any unixy garbage all around them.

I mean, how hard would it be to do:

ls -l /var/mail/ | grep company | awk '{print $3}'

It would take 3 more seconds to type. Granted, it took me 10 seconds to format it the right way, but if he sent it to someone else here, they would not be able to do that. And let’s face it – that format is a pain in the ass to read for anyone.

[tags]email, awk, list, grep, mail server, mail, it[/tags]

This entry was posted in sysadmin notes and tagged , . Bookmark the permalink.



4 Responses to How hard is it to AWK it?

  1. Starhawk UNITED STATES Mozilla Firefox Ubuntu Linux says:

    In the Beginning was the Command Line and I believe you might have been a bit too young to have mastered it then, but somehow ya might have gotten the hang of it Luke. lmao. A necessary skill i see as i try to learn linux, fortunately I never was scared of it, belonging to that generation of programmers that grew up with it. Yet perhaps it’s possible the dude that maintains your mail server is not as knowledgeable as you, or perhaps just doesn’t give a shit. Anyway awk is an old tool and not many even know about it. I know it’s universal in Linux/unix environments and even I who grew up with MS-DOS used a port of it. tho I basically only played with it some. It’s powerful and your post here clearly shows how much so, but I laughed my ass of reading that. I agree tho it was kinda rude of him to do ya that way, but ya know how people are!!

    Reply  |  Quote
  2. Luke UNITED STATES Mozilla Firefox Windows says:

    Well, the mail server admin has to have unix skills. It kinda comes with the territory – I’m assuming he was just being lazy. Either that, or it just didn’t occur to him that it would be possible to make my life easier with just 1 line of awk. ;)

    Reply  |  Quote
  3. Starhawk UNITED STATES Mozilla Firefox Ubuntu Linux says:

    Yeah i would think that the mail server admin has to have unix skills, He probably just don’t care. lol.

    Reply  |  Quote
  4. Patrick UNITED STATES Mozilla Firefox Linux says:

    I know this is a seriously old post but I’ve been reading newest to oldest for a couple of weeks now (at least the geeky type stuff). I once upon a time hosted a website and email for a company my wife worked for. I didn’t charge, only doing it to benefit her. Her partner decided to switch hosts overnight in some sort of delusional state maybe thinking it would hurt her or hurt my feelings or some other weird shit. Only after he repointed DNS did he think that he still needed access to his email. I copied the mail spool onto CD and dropped it by his office. I think he was expecting me to spend all kinds of time making it pretty when they weren’t paying me to begin with.

    Wonder why your email admin did it the way he did?

    Reply  |  Quote

Leave a Reply

Your email address will not be published. Required fields are marked *