Quote:
|
Originally Posted by vijay.amirthraj
I am executing a find command in my script i.e
find $2 -type f -name '*.gif' -mtime +$1 -exec rm {} \;
how do i check that this command is executed properly.. i would lke t trap the errror and display my error message
kinly help.. this is an urgent issue.
|
This depends on the shell you are using.
Shells that behave like the C-Shell use the variable: $status
Shells that behave like the Bourne (or Korn) shell use the variable: $?
These variables are set to the exit code of the last command executed.
BEWARE: in a "pipeline", the variable contains the exit code of the LAST command in the pipeline. All the other exit codes are lost.
==