[Info-vax] mkdir ?

Craig A. Berry craigberry at nospam.mac.com
Fri Jan 25 12:54:00 EST 2019


On 1/25/19 9:58 AM, John E wrote:
>> $ mkdir :== "''perl' -e ""mkdir $ARGV[0];"""
>>
>> after which
>>
>> $ mkdir testdir
>> $ mkdir ./testdir
>> $ mkdir [.testdir]
> 
> 
> Wow, that's really cool!  Can you use that for many other commands also?

Of course.

> I'll add that I've generally found little perl snippets like this to
> generally be the easiest way to sneak unix syntax into DCL.  For
> example, I have an overly complicated perl script to implement unix
> "cd" in a hybrid unix/vms manner such as the above.

This one is a little different because Perl's interface to chdir()
does not support the optional second argument in the VMS CRTL version
that tells the change to persist across image activations.  But there is
a way to do it with a VMS-specific extension that has been bundled with
the base distribution for a couple of decades or so:

$ cd :== "''perl' -""MVMS::Stdio"" -e ""VMS::Stdio::setdef($ARGV[0]) or 
die $^E;"""
$ cd /sys$manager
$ show default
   SYS$SYSROOT:[SYSMGR]
   =   SYS$SYSROOT:[SYSMGR]
   =   SYS$COMMON:[SYSMGR]
$ cd nosuchdir
%RMS-F-DIR, error in directory name at -e line 1.
%RMS-F-DIR, error in directory name

Hmm.  Maybe that error should be RMS$_DNF rather than RMS$_DIR.



More information about the Info-vax mailing list