[Info-vax] DCL enhancements

hb end.of at inter.net
Sat Jan 30 06:33:49 EST 2021


On 1/29/21 2:14 PM, Simon Clubley wrote:
> On 2021-01-28, Arne Vajhøj <arne at vajhoej.dk> wrote:
>>
>> Hoff posted a pointer to a trick in the old FAQ.
>>
>> And I think it can be combined with my approach:
>>
>> $ clean2 :== pipe purge/keep=2 ; d = f$getjpi(0, """PID""") ; cre/dir 
>> [.'d'] ; ren *.*.* /excl='d'.dir [.'d']*.*. ; ren [.'d']*.*.* []*.*. ; 
>> set prot=(o:rwed) 'd'.dir ; del 'd'.dir.*
>>
> 
> You write Perl code for fun don't you Arne ? :-)

Maybe he does. Maybe he only tries to avoid writing a command procedure.
Or maybe he tries to have something like a (bash) function.

He probably wants to exclude all directory files, just in case there are
already sub-directories in the current directory, which may not have the
right protection to be renamed.

And on recent versions of VMS he may want to use DELETE/TREE to get rid
of the directory file - without having to change the protections. (Yes,
if the directory is not empty, it isn't deleted. Yes, it turns on the
Delete bit for system and owner, which, after an error message that the
directory couldn't be deleted, is not restored to the previous setting.)

And then there is no reason to use the dot as separator for versions, as
long as only a separator for the command sequence, here the semicolon,
is preceded by a space character, which is the case in the shown
example. It can be written as:

$ clean2:==pipe purge/keep=2 ;d=f$getjpi(0,"""PID""") ;cre/dir [.'d']
;ren *.*;*/excl=*.dir [.'d']*.*; ;ren [.'d']*.*;* []*.*; ;delete/tree
'd'.dir;

FWIS, "$ pipe dir ;-1 ;show time" violates the above rule. It does not
work and gives a DCL-W-NOCOMD. It needs to be written as "$ pipe dir
*;-1 ;show time"

But, wouldn't it be useful to ensure each sub-command succeeds and use
&& instead of ; (which also doesn't require a preceding space character
or the dot as separator for versions)?

And yes, I write VMS PIPE commands for fun :-)



More information about the Info-vax mailing list