#!/bin/csh -f # xargsabort # ------------------------------------------------------------------------------ # Shell script to catch the return code of the executed command and change it # to 255 if non-zero so that the calling xargs command will abort. # ------------------------------------------------------------------------------ # Usage: See Usage section below or run with no arguments to see usage. # Assumptions: # Effects: # - Executes the specified command and returns 0 or 255, echoing the # real non-zero return code. # Notes: # Implementation Notes: # Portability Issues: # Revision History: # $Log$ # ------------------------------------------------------------------------------ if ($#argv < 1) then echo "Usage: $0:t command and args to be executed via xargs" exit 255 endif # Execute the params as a command and params. # :q = Quote each incoming arg in case it contains embedded spaces and such. $*:q set rc = $status if ($rc == 0) then exit $rc else exit 255 endif