[gradsusr] Automation my (ctl) descriptor file

Laws, Dennis MR 63134 dennis.laws at navy.mil
Tue Mar 8 18:15:16 EST 2011


Same here. Using template files at the shell script level, or a "here" document imbedded in a shell script and substituting with sed...  eg: sed 's/YYYYMMDDHH/2011030812/g' template.file > new.ctl

Dennis Laws
FNMOC Monterey



From: James T. Potemra
Sent: Tue 3/8/2011 10:29 AM
To: GrADS Users Forum
Subject: Re: [gradsusr] Automation my (ctl) descriptor file


Here's another way using a csh script.  Like Jennifer's method we have 
the top part
of the ctl file in a file called "ctl_template1" (basically everything 
before the "tdef"
line, and the bottom part in another file called "ctl_template2" 
(everything after the
"tdef" line.  We then cat the first file, get today's date, and cat the 
second file.
The resulting ctl file (final.ctl) has today's date as the tdef.

Jim


#!/bin/csh -f
cat ctl_template1 >! final.ctl
set day = `date +%d`
set cmon = `date +%b`
set year = `date +%Y`
echo "tdef ocean_time 29 linear 00Z$day$cmon$year 6hr" >> final.ctl
cat ctl_template2 >> final.ctl



Reynaldo Capia wrote:
> Hi everyone;
>
> I need to automate my tasks of GrADS;
>
> I have everything advanced, and I just want the following:
>
> => How can I do, to update the date every day of my descriptor file(ctl)
>       in this line (31 linear *00z08MAR2011* TDEF 06hr)?.
>
> I accept suggestions.
> Thanks.
> ------------------------------------------------------------------------
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>   
_______________________________________________
gradsusr mailing list
gradsusr at gradsusr.org
http://gradsusr.org/mailman/listinfo/gradsusr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20110308/38b63f48/attachment-0003.html 


More information about the gradsusr mailing list