* Re: Changing the '$' prompt
1991-09-06 10:48 ` havemann_l
@ 1991-09-06 11:10 ` havemann_l
0 siblings, 0 replies; 2+ messages in thread
From: havemann_l @ 1991-09-06 11:10 UTC (permalink / raw)
In article <1991Sep6.104837.1832@spcvxb.spc.edu>, havemann_l@spcvxb.spc.edu writes:
> In article <91248.122820U29970@uicvm.uic.edu>, U29970@uicvm.uic.edu writes:
>> Could someone please tell me how to change the '$' prompt to another prompt
>> displays the current default directory. I am using VMS 5.3. Thank you.
>> I'm looking for something like MS-DOS "SET PROMPT $P$G>"
>>
>> Neil Bhattacharyya
>> u29970@UICVM.BITNET
>
> $ foo :== 'f$getsyi("NODENAME")
^^^^^^^^^^^^^^^^^^^^^
This is the hostname prompt
> $ SET PROMPT="''foo'::yername>" (or whatever you want)
$ foo :== 'f$environment("default")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
$ SET PROMPT="''foo'::Yername>" (or whatever you want to add)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Woops - I forgot this part - thats the one that shows the default (current)
directory
Lee Havemann, Sys_op HSH Associates (201) 838-3330
Havemann_l@spcvxa.spc.edu - Havemann_l@spcvxa.bitnet
"Any opinions expressed are not necessarily those of anyone else,
including myself."
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Changing the '$' prompt
@ 1991-09-06 19:11 Phil Daly, JAC, 665 Komohana St, Hilo HI 96720, USA
0 siblings, 0 replies; 2+ messages in thread
From: Phil Daly, JAC, 665 Komohana St, Hilo HI 96720, USA @ 1991-09-06 19:11 UTC (permalink / raw)
A static prompt can be assigned using the command
$ SET PROMPT="''F$ENVIRONMENT("DEFAULT")'> "
A _dynamic_ prompt string requires a recursive procedure such as:
$! PROMPT.COM
$ X = 'F$VERIFY(0)'
$PROMPT:
$ READ/PROMPT="''F$ENVIRONMENT("DEFAULT")'> " SYS$COMMAND P1
$ DEFINE/NOLOG SYS$INPUT SYS$COMMAND
$ 'P1'
$ GOTO PROMPT
$ EXIT
In fact, you can put _anything_ in the command string. I wrote this
procedure years ago for a friend who used to work on a MULTICS system
and like having the current date and time returned as a prompt. The
same effect can be achieved in the above procedure by replacing
$ READ/PROMPT="''F$ENVIRONMENT("DEFAULT")'> " SYS$COMMAND P1
with
$ READ/PROMPT="''F$TIME()'> " SYS$COMMAND P1
Having said that, however, I wouldn't advise using the procedure (just
enjoy it!) as you're effectively working within a sub-environment and any
error will abort the procedure (as will typing `EXIT').
"Anything I say should be taken at your own risk with a hefty pinch of salt"
+------------------------------------------------------------------------------+
| | |
| | Telephone : +1 808 969 6568 (direct) |
| P N Daly | +1 808 961 3756 x268 (reception) |
| Joint Astronomy Centre | Facsimile : +1 808 961 6516 |
| 665 Komohana Street | Telenet DTE : 31528080905310 |
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1991-09-06 19:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1991-09-06 19:11 Changing the '$' prompt Phil Daly, JAC, 665 Komohana St, Hilo HI 96720, USA
-- strict thread matches above, loose matches on Subject: below --
1991-09-05 17:28 Changing the '$' prompt to [default dir] similar to MSDOS $P$G U29970
1991-09-06 10:48 ` havemann_l
1991-09-06 11:10 ` Changing the '$' prompt havemann_l
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox