RSS

So alike, yet so different

13 Mar

I’ve recently fallen into the world of Mac OS X. (Fallen, pushed; what is difference?)

I keep getting caught out by the little things that are just slightly different to what I’m used to in Linux.

Take the most recent example: the mail command. I had a little anacron script set up on my Ubuntu box that would generate a summary of a previously-unseen messages in a user’s Gmail spam folder, and send it to that user. (Mostly because Mrs E kept forgetting to check hers.)

While I was perusing the mail man page on Mac OS X, and reading up on various options on Google, I found that the Mac version had a useful -E switch that would allow it to quietly abort if there was no message body, saving me the hassle of having to find a recent port of moreutils so that I could use the ifne command.

The thing that got me stuck for ages was trying to find a replacement for the -a switch in the GNU/Linux version of mail, which allowed the insertion of arbitrary headers, and was useful for setting the sender to something appropriate.

Eventually, after much reading of man pages and search results, I realised that the answer had been staring me in the face for ages, I just wasn’t doing it correctly because the order of the parameters became more important:

echo Wibble | mail -s "Subject goes here" recipient-address@example.com -r "<mail-sender@example.com>" -F "Mail Sender"

That was harder than expected…

(Note to self: WordPress doesn’t tell you that it’s stripping out the content in angle brackets that you’ve just retyped three times…)

Advertisements
 
Leave a comment

Posted by on Tuesday 13 March 2012 in Geeky stuff

 

Tags: , , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: