The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 07-04-2006
dsbeerf's Avatar
dsbeerf dsbeerf is offline
Registered User
  
 

Join Date: Dec 2005
Location: Chicago, IL USA
Posts: 58
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.
==