Tiny Deathstars of Foulness

Yesterday I showed a way to get the serial number from a Mac OS X machine. However, as a couple of people pointed out, Apple will soon be adding another character to the serial number. This means that rather than use cut I should have used awk to allow for either serial number length. To grab the serial this way:
ioreg -l | grep IOPlatformSerialNumber | awk ‘{print $4}’
Or without the quotes:
ioreg -l | grep IOPlatformSerialNumber | awk ‘{print $4}’ | sed ‘s/”//g’

May 13th, 2010

Posted In: Mac OS X, Mac OS X Server, Mass Deployment

Tags: , , ,

  • Hey Charles,
    Nice pointers. Unfortunately WordPress strikes again, your print statement isn’t displaying properly, nor the double-quotes in the middle of the arguments passed to sed. Just a heads up for those trying to copy-paste that curly quotes are not tick marks. Thanks again,


  • notpeter

    Disable fancy quotes so cut/paste is possible.

    • Funny enough, for new articles I started doing so a few weeks ago; however, there are about 2,500 previous articles. Ick!