В OpenVMS, как я могу увидеть, откуда приходит команда - например, «который» в NIX

315
user1987442

Если у меня есть команда dosomething в OpenVMS, где я могу увидеть, откуда она берется (Расположение скрипта / exe - как это определяется, если это другой вид животного)

4

3 ответа на вопрос

2
STTR

$ ШОУ ПРОЦЕСС / ВСЕ

$ SHOW ENTRY

$ SHOW ENTRY / FULL

Не думайте, что это OpenVMS user1987442 11 лет назад 0
Вау, это мое эпическое невнимание. Правильный. STTR 11 лет назад 0
1
Gotfryd

There exists three DCL "sources" of, as you say, "coming from" something command like.

One warning: syntaxes with visible explicit DCL enforcement, like:

$'dosomething' 

are not counted here, only the "visible like command" ones.

Also explicit RUN or MCR commands are commands themselves, then run dosomething are out of interest.

How to check

  1. Symbols

    Function: like un*x alias or as "run a program with parameters", nearly like the MCR dosomething.

    Do a:

    $ show symbol dosomething 

    Symbols are "first use" (if used, then has priority over next steps)

  2. True DCL command

    There no build in utility to check the command table.

    However you can setup a freeware VERB utility.

    Then do a:

    $ verb dosomething 

    The "image" and "cliroutine" (in VERB output) shows the .EXE or internal DCL routine where runs the command.

  3. Path usage

    Do a:

    $ directory DCL$PATCH:dosomething 

    If a .COM or .EXE file exists, the command procedure runs nearly like after @DCL$PATH:dosomething or image of code runs like mcr DCL$PATH:dosomething.

    Path usage is a "last chance" one (only if symbol does not exist or not used and true DCL command does not exist also)

    "Nearly" in all description above because there are minor syntax interpretation difference, mostly irrelevant.

Some additional explanation

  1. If exists a symbol with name matching your "command", the content of symbol may be translated in two ways:

    • if the content begins with "$", the use is named "foreign command" and runs image (.EXE file) of rest of content, up to separator (parameter can be applied nearly like in alias); warning: the default directory of specified .EXE is SYS$SYSTEM:, not the default of process!

    • in all other cases the value may function like un*x alias.

    Value of symbol is "inlined" to the command line, and the substituted text is interpreted as ("new") command.

    The word "may" applies regarding of the SET SYMBOL setting (check HELP SET SYMBOL for VERB description).

    Be aware, that alias further explains to other real dcl syntax (true command, explicite "@" for procedure or "invisible" DCL$PATH use), but not to next symbol (alias or foreign command).

    It it strongly not recommended to substitute any true DCL command with aliases, DO NOT this!

  2. True command are set with the SET COMMAND command (obvious), the executable (.EXE image or internal DCL routine) names are not related in other way to the command name, even if most command has adequate names (the DIRECTORY command runs a SYS$SYSTEM:DIRECTORY.EXE etc, but APPEND runs COPY.EXE and HELP runs VMSHELP.EXE etc)

  3. Path is used like in un*x, but:

    • Only after the true commands table is checked (of course, also after the alias symbol use, but this is "un*x like")
    • The images intended for true command usage in most cases can not be used this way (exists somewhere runs with different syntax, example: INSTALL)
0
PKM

Не думайте, что в OpenVMS это работает именно так, и на самом деле нет надежного способа. Для DCL-шоу большинство квалификаторов заканчивалось бы в SYS $ SYSTEM: SHOW.EXE, но без файла MAP не было бы способа выяснить, какой исходный модуль фактически вошел в этот исполняемый файл. DCL не похож на Bash, где он запускает-исполняет другой процесс и загружает образ этой команды.

Похожие вопросы