[gradsusr] exit code from gribmap
Huddleston, John
Huddleston at cira.colostate.edu
Wed Dec 14 10:29:45 EST 2011
Bernd
Create an executable shell script somewhere in your $PATH called mygribmap.sh with the lines:
trap 'exit 0' ERR
gribmap $*
Call this script from within your current script with the arguments
mygribmap.sh -0 -e -i obs.ctl
John
-----Original Message-----
From: gradsusr-bounces at gradsusr.org [mailto:gradsusr-bounces at gradsusr.org] On Behalf Of Becker, Bernd
Sent: Wednesday, December 14, 2011 2:30 AM
To: GrADS Users Forum
Subject: [gradsusr] exit code from gribmap
Dear grads user,
I come up against a slight hiccup using gribmap in a cron job on a RH6 system:
I create a file and a copy in another place, create an index file change directory and create the index file again.
(why? because .ctl is template for many obs_$yyyy)
The problem occurs after gribmap finishes.
The return code is stops the shell form running any further after the first "gribmap" has finished. Regardless.
What do I need to do to go beyond "HERE!"
# make copy to $DATADIR/obs
cp obs_$yyyy.grb $DATADIR/obs/.
# make new index mapping file
( gribmap -0 -e -i obs.ctl && exit 0) ----------------------------!^ HERE!
cd $DATADIR/obs/.
( gribmap -0 -e -i obs.ctl && exit 0)
Best Regards,
Bernd.
--
Bernd Becker Climate Impacts Product Development
Met Office Hadley Centre FitzRoy Road Exeter Devon EX1 3PB United
Kingdom
Tel.: +44 (0) 1392 884511 Fax: +44 (0)870 900 5050 E-mail:bernd.becker at metoffice.gov.uk - http://www.metoffice.gov.uk/research/our-scientists/seasonal-to-decadal/
bernd-becker
http://www.metoffice.gov.uk/news/releases/archive/2011/weather-game
_______________________________________________
gradsusr mailing list
gradsusr at gradsusr.org
http://gradsusr.org/mailman/listinfo/gradsusr
More information about the gradsusr
mailing list