[Info-vax] Long uptime cut short by Hurricane Sandy
Paul Sture
nospam at sture.ch
Sat Feb 2 09:08:56 EST 2013
In article <keenff$tel$1 at Iltempo.Update.UU.SE>,
Johnny Billquist <bqt at softjar.se> wrote:
> On 2013-01-31 20:22, Bill Gunshannon wrote:
> > In article <keeb7i$e15$1 at dont-email.me>,
> > Stephen Hoffman <seaohveh at hoffmanlabs.invalid> writes:
> >> On 2013-01-31 17:38:45 +0000, VAXman- @SendSpamHere.ORG said:
> >>
> >>> $ filename =
> >>> filenameprefix+"_"+F$fao("!19AS",F$cvtime(,"COMPARISON"))-"-"-"-"-"
> >>> "-":"-":"+".dmp"
> >>
> >> Yeah. Or add the prefix and the underscore into the f$fao, as that
> >> avoids clobbering caracters in the prefix.
> >
> > And tell me how the above is not cryptic? Just what is the difference
> > between the first dash and the second? Or the third? And would anyone
> > normal determine that? :-)
>
> Maybe it would be more obvious with some appropriately placed spaces...
>
> $ filename = filenameprefix + "_" +
> F$fao("!19AS",F$cvtime(,"COMPARISON")) - "-" - "-" - "-" - ":" - ":" +
> ".dmp"
>
> Ie, remove three dashes and two colons, and then add something at the
> end. (Ignoring what's going on at the beginning.)
I prefer to space it out like that.
> As the for F$FAO and F$CVTIME functions, you obviously need to read the
> documentation to know exactly what they produce.
Certainly when I've been away from DCL for a while, I will put a comment
in such as:
$! F$cvtime returns yyyy-mm-dd hh:mm:ss.cc. Strip dashes and colons.
Actually, in this example I'd probably use f$element delimited on the
space to get separate date and time variables, which I'd concatenate.
Here's the bash I use to format a daily backup prefix:
# Get date as YYYY.MM-DD-HHMM
NOW=$(date +"%Y-%m-%d-%H%M")
DUMPID="sture-$NOW"
echo $DUMPID
Sample output:
sture-2013-02-02-1507
--
Paul Sture
More information about the Info-vax
mailing list