Some corrections & additions:
[EMAIL PROTECTED] wrote:
Carl Friedberg wrote:info help
!LINUX: VMS: !mkdir create/dir !ls dir !ls -la dir /fu !(warning, there are no hidden directories on VMS) !(there are available HARDLINKS starting in 7.3-1) !vi edit !(warning, no vi emulation to my knowledge...) !ps monitor system !free show memory !cat type !more type /page !tail type /tail !perl perl *
In fact I'll add a few commands:
LINUX: VMS: man help
grep pattern file search string filespec(s)
search filespec(s) string
- note wrong order
cd directory set default [.directory]
lsof show devices /file
cc -c -switch cc /qualifier
link
ld link
. (sh, bash) @ source (csh, tcsh) @ at submit/after=time date show time pwd show default exit logout
Some explaination should be given of VMS paths and logical names. Here's an off the cuff effort below:
-- Pat
VMS File Path Syntax ====================
Unlike in Unix, a file path in VMS consists of several distinct componants which may be distinguished from each other by unique file path seperator characters. A useful characteristic to keep in mind is that if part of the path stays the same as the current 'file path context', it need not be respecified.
For example, a complete file path on VMS might look something like the following:
NODENAME"username password"::DISK:[topdir.second.third]filename.ext;REV
If instead you wanted to refer to something on the same node, you could use the following:
DISK:[topdir.second.third]filename.ext;REV
If you wanted to refer to a disk with the same name on a different node as the same user you are currently logged in as, the following might work:
NODENAME::[topdir.second.third]filename.ext;REV
If you just wanted to look in a subdirectory of your current directory, use this:
[.subdir]filename.ext;REV
A couple of useful rules to remember.
*) Leave off the revision number (REV - see file version numbering below for a complete explaination) and it will default to the latest revision
*) Revision numbers (REV) can be a negative offset, which means -N revisions from the current one. E.g. filename.ext;-3 means the 4th most recent revision.
*) The dash "-" used in a directory name means the parent directory. Eg: [.-.-] is two directories above your current directory
*) Ellipses used as the last part of a directory means "and all subdirectories". Eg: [topdir...]*.* means all files in [topdir] and everything below it
Logical Names and VMS File Paths ================================
VMS has a facility similar in some ways to the Unix concept of environment variables, called Logical Names. (VMS Has another, very superficially similar facility called symbols, but we'll cover that later)
The nice thing about logical names is that they can be transparently used to substitute for part of a file path. You don't need to use any special syntax, the filesystem handling code in VMS (RMS) transparently performs logical name substitution for you, with no extra effort.
The only limitation is that a logical name must always appear at the _start_ of a path, and is terminated in a path by a colon. Here's how it can work.
A logical name can substitute for 3 distinct subsets of a VMS file path:
1) The node and or disk name:
For example, if you have the path: NODENAME"username password"::DISK:[topdir.second.third]
You could do this: $ define remote_machine "NODENAME""username password""" $ dir remote_machine::DISK:[topdir.second.third]
Note the double quotation marks, that's to pass the special character though the VMS shell, DCL, similar to using a backslash on Unix.
or this: $ define remote_disk "NODENAME""username password"::DISK:" $ dir remote_disk:[topdir.second.third]
or even use one logical inside another, like this: $ define remote_machine "NODENAME""username password""" $ define remote_disk "remote_machine::DISK:" $ dir remote_disk:[topdir.second.third]
2) For the (optional) node and disk name, and _part of_ the directory path. This is refferred to as a "rooted" logical, and can be used identically to a DISK specification normally.
For our example above, we could do this: $ define remote_machine "NODENAME""username password""" $ define remote_disk "remote_machine::DISK:" $ define/translation=concealed PSUEDODISK remote_disk:[topdir.] $ dir PSUEDODISK:[second.third]
There are two limitations to be aware of for rooted logical names.
a) First, the directory specification part must end in a period, followed by a right square bracket. E.g. disk:[path1.path2.], not disk:[path1.path2]
b) Second, unlike other logical names, there can be only one rooted logical name used in a path, a rooted logical cannot translate into another rooted logical.
3) Finally, a logical name can refer to a fully qualified directory and/or a full directory and filename.
For example $ define remote_machine "NODENAME""username password""" $ define remote_disk "remote_machine::DISK:" $ define remote_path remote_disk:[topdir.second.third] $ dir remote_path:
or $ define remote_machine "NODENAME""username password""" $ define remote_disk "remote_machine::DISK:" $ define remote_path remote_disk:[topdir.second.third] $ define remote_file remote_path:filename.ext $ dir remote_file
There are lots of other wierd and wonderful things you can do with logical names, such as putting a list of files or directories into one, using them to refer to devices or batch queues, or messing around with the directory of tables containing logical names, etc, but those topics are for a later, more advanced, section.
Specifying a new command at the shell (DCL) prompt ==================================================
In Unix, in order to be able to execute a command from a shell, one simply inputs the command as the first item in a command specifier. The Unix shell then searches first it's own internal command tables, then for a file with a matching name on a list of directories specified in the PATH environment variable.
Unlike Unix, with the advent of revision 6.2 of VMS, there are at least five methods to run a command from the faithful DCL dollar sign prompt.
1) First, like Unix, the DCL shell has a number of built in commands. Unlike unix, however this list of built in commands can be dynamically extended using a special language, called appropriately enough, Command files, or CLD files.
This feature on VMS is especially neat, since a command with a properly specified CLD file can perform almost it's entire option processing without ever invoking the target program, amoung other neat stuff.
Individual CLD files can be loaded into your DCL interpeter using the 'set command' command. Type 'help set command' to see how to use this
2) The simplest way to invoke a program is to use the "run" command under VMS. This is rarely used from the command line, however, since there is no mechanism to specify parameters to the program run, all the parameters apply to the RUN command itself.
It is heavily used, however, to run the VMS equivilent of Unix daemons, called detached processes. Type 'help run/detached' to get more information on doing this.
To run a specific program using this, simply type 'run program.exe'
3) An undocumented but widely used mechanism to run a program that isn't in DCL's command tables is the 'MCR' command. Unlike 'RUN', 'MCR' does allow command parameters. It's used like this:
$ mcr disk:[dir.subdir]program.exe param1 param2 ...
Note that you will have to specify at least a partial path to MCR. Unlike other, documented, VMS commands, it does not use the current default directory (pwd on Unix).
4) If you want to run a command without using any of the tricks above, you can use the VMS symbol table to specify commands in a "shorthand" manner, like this:
If you have a program like this: disk:[dir1.dir2]someprogram.exe or a script like this: disk:[dir1.dir2]somescript.com
You can make a DCL 'shorthand' command for these two things like this:
$ someprogram :== $disk:[dir1.dir2]someprogram $ somescript :== @disk:[dir1.dir2]somescript
There are a couple of caveats to be aware of:
a) Use "$" for compiled code (EXE's), and "@" for DCL scripts (COM's)
b) Unless you specify the file extension, it's assumed to be EXE for executables, and COM for scripts.
You can put a list of these command definitions into your LOGIN.COM file to have them handy for use.
5) Finally, as of VMS 6.2, VMS has implementated a Unix like PATH specifier.
If you type a command at a VMS prompt, DCL will first search it's internal command table, then it's 'shorthand' commands for a matching name. If it does not find any, it will then search the list of directories contained in the special logical named DCL$PATH for an executable or script with a matching filename.
So, for example, you could do the following:
$ define dcl$path disk:[gnu_stuff.bin], disk:[perl.5_6_1], -
disk:[scripts]Then, if you typed 'perl' at a dcl prompt, and you had a 'perl.exe' in disk:[perl.5_6_1], it would find and execute that program.
--
This message does not represent the policies or positions
of the Mayo Foundation or its subsidiaries.
Patrick Spinler email: [EMAIL PROTECTED]
Mayo Foundation phone: 507/284-9485