Over the years we have added a number of UNIX® features to VOS. One of the simplest and most useful of these is the ability to use dot (“.”) and dot-dot (“..”) as pathnames. A single dot accesses the current directory, and a double-dot accesses the parent of the current directory. This can really shorten the amount of typing you must do for some common commands. I like to use them to view and modify access control lists.
Here is the traditional method:
display_access_list (current_dir)
and here is the same command using a dot:
display_access_list .
Of course, I suspect that most of you, like me, have an abbreviation for display_access_list, in which case the command becomes:
dal .
That’s nice and short!
Technically, the presence of the dot or dot-dot is detected when the pathname is expanded from a relative pathname to an absolute pathname. This means that pathnames containing these two sequences are handled similarly to relative pathnames. You can use these pathnames in command macros and at command level, but you can’t pass them directly to system subroutines. You must call s$expand_path on them to convert them from relative pathnames to full pathnames.
Just as in UNIXor Linux, where you can type “./foo” to reference a file in the working directory, you can type “.>foo” to reference a VOS file in the current directory. (Of course, this idiom is necessary on UNIX because sites do not typically search the working directory for commands or shell scripts. It is generally not necessary on VOS because most sites do set up their command library paths so that they do search the current directory for commands and command macros).
Hope you enjoy using them.
If you know of similar tips for simplifying VOS commands, please leave a note in the comments.