<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi Marie,<br>
<br>
In a grads script try executing a separate script (say,
"date.formatted")<br>
that runs an operating-system command (on linux it might work like
this):<br>
<br>
"!~/bin/date.formatted"<br>
ret = read(grads.print.date)<br>
"!rm grads.print.date"<br>
<br>
status = sublin(ret,1)<br>
if (status != 0)<br>
say 'error reading grads.print.date'<br>
endif<br>
today = sublin(ret,2)<br>
<br>
where the separate script produces a temporary text file<br>
(grads.print.date) in the current directory that contains the<br>
date of interest. Again on linux, this "date.formatted" command<br>
would be placed with other executables in the $PATH) and might<br>
contain an operating-system command like this:<br>
<br>
date +"%y-%m-%d-%H-%M-%S" > grads.print.date<br>
<br>
Note that if your operating system provides a command to generate<br>
today's date, you can often tailor it to produce whatever format
might<br>
be useful inside a grads script. If you're reading between the
lines<br>
here, the message is use the right operating system...;)<br>
<br>
Cheers,<br>
Rick<br>
<br>
<br>
<div class="moz-cite-prefix">On 07/05/2013 03:12 PM, Marie Staerk
wrote:<br>
</div>
<blockquote cite="mid:DUB109-W200696840B284AAB3D8BC7A77D0@phx.gbl"
type="cite">
<div dir="ltr">
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style>
<div dir="ltr">Hello,<br>
<br>
I wonder if there is any simple way to automatically get the
current date in GrADS?<br>
I want to create a script which uses the latest gfs data
whithout having to specify the time i.e. automatically uses
the current date. <br>
<br>
For example I want to write something like this: @ sdfopen
<a class="moz-txt-link-freetext" href="http:\\nomads.ncep.noaa.gov:9090/dods/gfs$YYYYMMDD/gfs_00z">http:\\nomads.ncep.noaa.gov:9090/dods/gfs$YYYYMMDD/gfs_00z</a>,
where $YYYYMMDD represents the current date. <br>
<br>
Kind Regards<br>
Marie <br>
<br>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
gradsusr mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a>
<a class="moz-txt-link-freetext" href="http://gradsusr.org/mailman/listinfo/gradsusr">http://gradsusr.org/mailman/listinfo/gradsusr</a>
</pre>
</blockquote>
<br>
</body>
</html>