Commonality in Unix Command Errors

We’ve got a script that parses install logs for each Solaris client looking for errors and then generating a summary report of what happened and what went wrong. It works well, but until recently, it’s been quite limited as it only flagged variations of the words Error and Warning. That was ok originally, but the install scripts got more complicated and it’s now been out grown.

After seeing a few variations on “cannot”, including “can not”, “can’t” and “could not” and “couldn’t” showing up in the logs, I thought it’d be interesting to audit some of the common unix commands we use in the scripts and see what sort of words they use to describe errors. It turned out to be quite a long list.

These are all taken from Solaris 10 10/08 clients. Where relevant I’ve kept them case sensitive.

cp/mv/ln

  • failed / Failed
  • cannot
  • could not
  • unable
  • not
  • can’t
  • Insufficient
  • exceeds
  • Invalid

mkdir

  • Failed
  • but is not
  • not permitted

touch

  • bad
  • cannot

chown

  • can’t
  • unknown
  • invalid
  • too large

chmod

  • can’t
  • could not
  • invalid
  • required
  • not permitted
  • WARNING
  • ERROR

ls

  • can’t

ksh

  • too big
  • required
  • couldn’t
  • prohibited
  • cannot
  • Bad / bad
  • failure
  • unknown
  • invalid
  • is not
  • not
  • denied
  • too many
  • corrupted
  • can’t
  • out of range
  • exceeds
  • already
  • restricted
  • missing
  • expected
  • failed
  • requires

The thing about most unix commands is that they’re generally not very chatty. There’s a good chance if they’re producing any sort of output at all, it’s probably an error of some description. With that in mind, it’s quite possible there’s a much more elegant way of writing the parse scripts.

Leave a Reply