Hits since 2023-09-15 14:32:53:
996
|
|
Short Answer:
Intermediate Answer:
SAM is a command line tool (for Slackware Linux) which uses a stack
to provide control of variables, including PATH, and functions.
To do this it uses a set of scripts, functions and compiled code.
The result is a command line environment that changes the way you see
and thus changes the way you think. It has helped me to write
more and better shell code. Perhaps it will help you
also.
Long Answer:
What if you could dynamically create a Linux shell
possessing a command set that allowed you to change the
command set within that shell?
That is what SAM does for Slackware Linux.
Dynamically here refers to the manner of execution and
may not be the best word. I'm talking about three
features:
SAM allows you to both open the SAM shell and pass
commands to it, all in one invocation.
By default the shell remains open, with a working command
line, until you exit from it.
Alternatively, you may instruct SAM to run in "batch"
mode.
The SAM invocation needs a full path specification of
the begin command which is found in the root of
SAM. To install SAM, simply unpack it.
Command set here means the union of all (qualifying)
sourced-and-exported functions and all commands available through
the current definition of PATH. You use bound
to change the command set--without leaving the current
shell. It works by changing the definition of PATH
followed by running "hash -r" and by a combination of unset-ting,
sourcing and exporting functions. The commands that do this
manipulation of PATH and functions push part of the environment onto
a stack.
This allows SAM to retain previous values of PATH, PS1 and all
variables that begin with lower case, and--later when
needed--redefine and re-export certain previous functions.
This, in turn, allows the user to return to a previous state (the
values of PS1 and variables that begin with lower case, and the
command set) by use of the bye or
pop commands--again without leaving the current
shell.
Click in the menu at the left to learn more about SAM or to
download the distribution.
|
|
|