Re: DCL Magic?
- From: "hellpenny@xxxxxxxxx" <hellpenny@xxxxxxxxx>
- Date: 3 May 2007 13:00:21 -0700
On Apr 24, 4:43 pm, Johann 'Myrkraverk' Oskarsson
<myrkrav...@xxxxxxxxxxxxxxxxxxxxx> wrote:
Bob Koehler <koeh...@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> writes:
In article <00A66925.7CDCD...@xxxxxxxxxxxxxxxx>, VAXman-
@SendSpamHere.ORG writes:
What happens when a program called SYS$SETDDIR() and then drops out to
DCLwhere the default was set in the program?
The same as when they use "set default" instead of the .COM file.
But then I never did like path names taking up 80% of my command
line.
zsh has some string manipulation/substitutionmagicthat allows one to
truncate a string like path names. That way, you can display only the
last n characters of the path name in your terminal title, or prompt.
I've forgotten the actual syntax, but can probably dig it out from my
.zshrc.
Johann
Johann,
Here is the solution I came up with ...
visit this download page and follow instructions to download
and check out _my_ "SD" offering.
http://hellpenny.googlepages.com/holdmisc
Once installed, you can do what you're attempting with:
$ @SDSYM +T=(S) +N +V ! intial LOGIN setup
$ sd; ! turn off prompt string
tailor/
! & turn on +T top
display
in your LOGIN.COM. This will attempt to display your default
in your XTERM (or xterm-compatible) banner. If that doesn't
work, use +T=(S:0) to use line 25 of a VT with status line
capability (VT320 or greater??). If that doesn't work, you can
use +T=(S:1) which will punt and write a reverse video line
on the top line of your screen and define the rest as a scrolling
region. [ Note: the first option S (no option) works great with
PuTTy or xterm/rxvt while S:0 (25th line status) works great on
later model VT's. I don't really use S:1 but it will mostly do
the job if the other options don't cut it.
The line shows up in reverse video and is formatted similar to:
NODE::DEVICE:[DIRECTORY] (VOLUME)
If all those options don't appeal, use
$ sd,
to enable tailoring of your prompt string to match the default.
With tailoring the prompt, you are limited to 32 chars so there
are many options for 'shortening' it and still keeping it meaningful.
For instance, I use:
$ sd, +n="VAX" - ! Cut the string "VAX" from nodename and display
+v=(F:1,L:2) ! Display First char + Last 2 chars of vol
label
D01::U63:[MOOREJ] > SH DEF
USER63:[MOOREJ]
D01::U63:[MOOREJ] > WRITE SYS$OUTPUT F$TRNLNM("SYS$NODE")
DVAX01
You can turn off node and volume display with $ SD, -n -v if you
just want the dir - [MOOREJ] >
If the prompt string gets too long as you descend dirs, "default"
abbreviation action is taken to preserve the most relevant info
possible.
D01::U63:[MOOREJ] > SD....EXAM*
USER63:[MOOREJ.VDBM04.EXAMPLES]
D01::U63:[*J.VDBM04.EXAMPLES] >
Is an example or the abbreviation.
There are way too many options to explain briefly so Use SD?
to see basic help SD?? for intermediate and SD??? to see
the whole library of functions.
Another problem mentioned in the thread ... when you run another
program
which changes the default, what happens? My solution to this
(assuming you
know in advance what programs you expect default changes to come
from...)
you can do this:
For instance I use SWING (from decus lib) or DOWN on occassion to
navigate
complicated dir trees and everytime I would change default using these
programs my prompt would be incorrect. I added a way to *hook* these
command
symbols thru my SD routine. It's simple to use .. I specify it as an
option
to the TOP display flag +|-T
Example -
$ sh sym SWING
SW*ING == "@PUB:[UTIL.cswing]cswing"
$ sh sym DOWN
DOWN == "@PUB:[UTIL.down]down"
$ sh sym CLR
CLR == "$cluster$common:clrscrn.exe"
$ SD; +T=(S,C:SW*ING;DOWN;CLR) ! Make these commands 'known'
to SD
$ sh sym SWING
SW*ING == "@PUB:[UTIL.com]sd &SWING"
$ sh sym SD$COMMAND_SWING
SD$COMMAND_SWING == "@PUB:[UTIL.cswing]cswing"
So now when one of these commands gets typed, it actually calls SD
with the
'hidden' & function (which invokes the original command SD
$COMMAND_symbol)
and then updates the prompt (or top line display if you were using
that -
hence the 'CLEAR SCREEN' - CLR command would 'redraw' the top bar if
the TOP
bar/scrolling region was being used).
This is not a perfect solution (one which could "sense" when the
prompt string
needed to be corrected/updated) but it's as close as I could come and
does
an adequate job.
Try it! You'll like it.
Regards,
-John Moore
Sr. Unix Admin / WorkflowOne
(Aging vax-hacker...)
.
- Prev by Date: Re: detect unaligned data access
- Next by Date: Re: Free used AlphaServers
- Previous by thread: ANN: Alpha firmware update CD v7.3 released
- Next by thread: Re: DCL Magic?
- Index(es):
Relevant Pages
|