Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: pnd@jach.hawaii.edu (Phil Daly, JAC, 665 Komohana St, Hilo HI 96720, USA)
Subject: Re: Changing the '$' prompt
Date: 6 Sep 91 19:11:55 GMT	[thread overview]
Message-ID: <14728@uhccux.uhcc.Hawaii.Edu> (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                    |


             reply	other threads:[~1991-09-06 19:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1991-09-06 19:11 Phil Daly, JAC, 665 Komohana St, Hilo HI 96720, USA [this message]
  -- 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
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox