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 > Shell Programming and Scripting
.
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 05-24-2007
aigles's Avatar
aigles aigles is offline Forum Advisor  
Registered User
  
 

Join Date: Apr 2004
Location: Bordeaux, France
Posts: 1,420
Try to use the 'set -e' command.
Extract from man page :

Quote:
-e If a command has a non-zero exit status, execute the ERR
trap, if set, and exit. This mode is disabled while reading profiles.
Code:
set -e
export id=root
export db=testcsv
export db_add=localhost

mysql -h$db_add -u$id -D$db <loadA.sql
Jean-Pierre.