T.R | Title | User | Personal Name | Date | Lines |
---|
269.1 | | CLT::GILBERT | Juggler of Noterdom | Fri Jul 04 1986 01:18 | 41 |
| How about:
$ SPAWN/PROMPT="$$"
Or invoke the following command procedure:
$ x = "sub-" + f$envi("PROMPT")
$ spawn /prompt=&x
Because most utilities don't allow all the SPAWN qualifiers, this
doesn't quite meet your specifications.
However, since your intention is to distinguish subprocesses from
the main process, you could use the 'dyna-prompt' tool in the STC
to dynamically change your main process's prompt string, while
those of the subprocesses remain constant (snapshotted at the
point where they were spawned).
However, since your *real* intention is to avoid inadvertant logouts
in your main process, why not simply define the symbol LO*GOUT to
invoke a command procedure that checks whether the current process
is the main process?
Typically, I just use CTRL/T to tell whether I'm in a subprocess,
judging this from the subprocess name.
I tried dyna-prompt, and liked the concept, but not the prompt
strings (the current time). So I changed my 'set-default' command
procedure to also set the prompt string to the current default directory,
less the main directory, and with a "> " tacked to the end. For example,
when my default directory is "[GILBERT.NCS.XSRC]", the prompt string
is ".ncs.xsrc> ". I like it. The incantations are:
$ PROMPT = F$DIRE()-"["-"]"-"<"-">"
$ PROMPT = F$EDIT(PROMPT,"LOWERCASE")
$ PROMPT = PROMPT - F$ELEMENT(0,".",PROMPT) + "> "
$ SET PROMPT="''PROMPT'"
Hackers will note that that last line could also be:
$ SET PROMPT=&PROMPT
|
269.2 | Here's how I return from a subprocess | SIVA::LAMIA | | Mon Jul 07 1986 10:26 | 12 |
| Being an old TOPS-20 hacker, I relate to the command "POP" to return
from a subprocess, instead of LOGOUT. I therefore have the following
defined in login.com:
$ pop :== "IF F$GETJPI("""",""PID"") .NES. -
F$GETJPI("""",""MASTER_PID"") THEN $LOGOUT"
then whenever I want to return a process level, I just say POP,
and if I'm already at the top level, nothing happens. Of course,
you could define LOGO the same way.
%walt
|
269.3 | Thanks for the help | VOX::MINOW | Martin Minow, DECtalk Engineering | Mon Jul 07 1986 12:54 | 6 |
| Thanks Walt -- just what I needed.
Except that it seems to want the command to be on
one line.
Martin.
|
269.5 | remembering how many levels down you are | AVANTI::OSMAN | and silos to fill before I feep, and silos to fill before I feep | Mon Jul 21 1986 12:07 | 33 |
|
<<< CLOSET::SYS_:[NOTES$LIBRARY]COMMAND_PROCEDURES.NOTE;1 >>>
-< DCL Command Procedures >-
===============================================================
Note 4.17 Creative (?) DCL Prompts 17 of 29
SPRITE::OSMAN 24 lines 16-DEC-1985 13:14
-------------------------------------------------------------------------
Sometimes you forget you're spawned down a level. Suppose you'd like your
current prompt to be
foo>
When you've spawned, suppose you'd like your prompt to be
foo>>
to remind you that you're down a level. If you have need to spawn another
level (hopefully only temporarily :-), you'd like your prompt to be
foo>>>
The following three lines, if inserted in your login.com, will provide
the above mechanism. When you test this, use "ns" instead of "spawn".
Use "spawn" when you are spawning a single command, for example,
"spawn submit zot". Use "ns" for spawning to an interactive level:
$ set prompt = "foo> "
$ np == f$environment ("prompt") - " " + ">" + " "
$ ns == "spawn/in=sys$input:/prompt=&np np == np - "" "" + "">"" + "" """
/Eric :->>>
|
269.6 | Here's how I set *my* prompt. | NANUCK::SSMITH | Sheldon Smith @MPO | Mon Jul 21 1986 19:48 | 31 |
| (OOPS! I deleted my earlier .3 - I'd put in the wrong command file.)
I wasn't aware of the /PROMPT qualifier on the SPAWN command.
Anyway, I've been using the following command procedure to set my
prompt string to "<node>_<extra>", where <node> is simply the node
I'm on, and <extra> is either:
- the terminal device name if I'm in my main process, or
- the number of the subprocess ("NANUCK_1$ " if I'm in the
subprocess named SSMITH_1
By the way, the procedure PRIVS (commented out) takes my prompt
string and adds VT highlights to it if I have privileges turned
on. The highlights vary depending on what classes of privileges
are turned on. Only "Bypass" turns on *everything*.
If anybody is interested, I'll mail it. If enough people want it,
I'll post it here.
$ Verify = f$verify( 0)
$ NODE = f$logical( "SYS$NODE") - "_" - ":" - ":"
$ USERNAME = f$edit( f$getjpi( "", "USERNAME"), "TRIM,UPCASE")
$ TERMINAL = "_" + f$edit( f$getjpi( f$getjpi( "", "MASTER_PID"), -
"TERMINAL"), -
"TRIM,UPCASE") - ":"
$ if f$getjpi( "", "MASTER_PID") .eqs. f$getjpi( "", "PID") then goto 10$
$ TERMINAL = f$edit( f$getjpi( "", "PRCNAM"), "TRIM")
$ TERMINAL = f$extract( f$locate( "_", TERMINAL), 1023, TERMINAL)
$10$: PROMPT = f$extract( 0, 32-4, NODE + TERMINAL)
$ set prompt= "''PROMPT'=$ "
$ @Commands_:PRIVS.com QUIET
$ Verify = f$verify( Verify)
|
269.7 | Digital Had It Then | VAXUUM::DYER | Wage Peace | Thu Jul 24 1986 17:47 | 4 |
| I remember when VMS told you that you had subprocesses
(I think it said "you have sons" - an interesting error
message) when you tried to log out from the main process.
<_Jym_>
|