Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Apr 2011 16:00:52 +0200
From:      Bastien Semene <>
Subject:   redirecting command output depending on exit status
Message-ID:  <>

Next in thread | Raw E-Mail | Index | Archive | Help
Hi list,

I have a cron task set up using lockf.

I'd like to redirect one exit status to /dev/null :

"it (lockf command) returns one of the exit codes defined in
      sysexits(3), as follows:

      EX_TEMPFAIL   The specified lock file was already locked by another

      EX_CANTCREAT  The lockf utility was unable to create the lock 
file, e.g.,
                    because of insufficient access privileges.

      EX_USAGE      There was an error on the lockf command line.

      EX_OSERR      A system call (e.g., fork(2)) failed unexpectedly.

      EX_SOFTWARE   The command did not exit normally, but may have been 
                    naled or stopped."

I don't care about the EX_TEMPFAIL output as I consider it as a 
successful exit status, not an error.

I there a trick to do that in a short way ?

Bastien Semene
Administrateur Réseau&  Système

Cyanide Studio - FRANCE

Want to link to this message? Use this URL: <>