I am looking for some assistance with openVMS.
The default prompt under VMS is $
I want to update this to reflect the current working directory that I am located in as I can in Unix/Linux when I change directories.
I created a file named login.com and put this into my home directory in the openVMS system and added the following code:
$ SET PROMPT='f$environment("default")'
Which should work by displaying the current directory, however it only reflects my home directory at the time of login. It is not dynamically updating as I change directories. If I run the above command in the terminal it will show the current directory.
Is there anyway to update the login.com to dynamically update the prompt each time that I change the directory?
The best you can do as far as I know is to create a command file to change the directory and set the prompt.
Create a file called
CD.COMwith the following:You can change the condition in the loop depending on how long you want the prompt to be
Then in your
LOGIN.COMfile create a logical to point to the directory with theCD.COMfileThen use it like this:
or
The only time this will not update the prompt correctly is if you use the
CDcommand inside another COM file. It will however still change the directory correctly.