[Info-vax] Long uptime cut short by Hurricane Sandy

VAXman- at SendSpamHere.ORG VAXman- at SendSpamHere.ORG
Thu Jan 31 11:32:44 EST 2013


In article <kee28h$6eo$1 at dont-email.me>, Stephen Hoffman <seaohveh at hoffmanlabs.invalid> writes:
>On 2013-01-31 14:13:55 +0000,   VAXman-  @SendSpamHere.ORG said:
>
>> Show me... without PIPES and myriad other *IX utilities.  Compare only 
>> /bin/bash scripting semantics with DCL's.
>
>Um, why?  I've already indicated that the bash shell syntax is cryptic.
>
>I haven't written very many bash scripts without using at least some of 
>the Unix utilities, or without using pipes.  I also haven't written 
>very many DCL procedures that would meet the same requirements, as most 
>common DCL commands are external to the DCL CLI, and I'm finding PIPE 
>quite useful in a number of procedures.
>
>If there's a discussion of syntax, I've already granted that bash is 
>more cryptic than DCL.  Far more.  Yes, DCL has its share of cryptic 
>syntax, too.  This starting with the quoting, and the two-pass 
>substitution using apostrophes and ampersand, and particularly when 
>mixing quotes and apostrophe and ampersand and PIPE, and when quoting 
>substitutions.  Is DCL a paragon of clarity?  No.   But is this DCL as 
>cryptic as bash?  No.  Nowhere near.
>
>While the following technically violates the requirements, here's a 
>simple bash construct that's very handy:
>
>filename=$filenameprefix"_`date +%Y%m%d%H%M%S`.dmp"
>
>For those unfamiliar with bash, this invokes the date command — one of 
>those myriad Unix utilities — in-line and loads a sortable date and 
>time directly into the filename specification.
>
>Can you perform the same sequence entirely in DCL using lexical 
>functions?  Sure.  Bash and DCL are both Turing Complete, so you can do 
>most anything you need[1].  Here's the DCL version of the previous 
>example, and this version avoids calling out[2] to external executables:
>
>$ filename = filenameprefix + "_" + f$cvtime(,,"YEAR") + 
>f$cvtime(,,"MONTH") + f$cvtime(,,"DAY") + f$cvtime(,,"HOUR") + 
>f$cvtime(,,"MINUTE") + f$cvtime(,,"SECOND") + ".dmp"
>
>I've written this DCL many times, as has VAXman, as have many other folks.

Or, skip the myriad excursions through LIB$CVT_TIME and LIB$CVT_DTIME, and
let DCL do one of the things it does best...

$ filename = filenameprefix+"_"+F$cvtime(,"COMPARISON")-"-"-"-"-" "-":"-":"-"."+".dmp"

-- 
VAXman- A Bored Certified VMS Kernel Mode Hacker    VAXman(at)TMESIS(dot)ORG

Well I speak to machines with the voice of humanity.



More information about the Info-vax mailing list