💾 Archived View for uhc.megaburken.net › help › SetFromCmd captured on 2024-05-26 at 14:40:52.

View Raw

More Information

⬅️ Previous capture (2021-11-30)

-=-=-=-=-=-=-

SetFromCmd     - Set env from output of command. The command result will be
                 returned to $RC, which regular "Set and backticks" won't do.

Usage: SetFromCmd NAME/A,GLOBAL/S,SAVE/S,COMMANDLINE/F/A

NAME:        Name of the destination environment variable.
GLOBAL:      Set if it should be a global environment variable, which
             normally is saved in ENV:. Default is to create a local
             environment variable in the current shell.
SAVE:        Set if the environment variable should be saved in ENVARC:. This
             will also imply that it will be created as a global environment
             variable.
COMMANDLINE: The complete commandline to execute.

Example:
1> SetFromCmd REVISION aget http://uhc.driar.se/uhctools_revision TOSTDOUT

Relevant info:
- It will capture all output from the command, including SAS/C-style stderr
  and AmigaOS4 ErrorOutput().
- If the executed command attempts to read from its stdin/Input(), the reads
  will be forwarded to SetFromCmd's stdin/Input().