Please enable JavaScript to view this site.

A-Shell Reference

The -e switch is used in conjunction with the optional command name and forces A-Shell to exit to the host shell prompt on completion of the command. This is useful for preventing users from ending up at the A-Shell command prompt (where they might be lost or even do damage) if the application terminates unexpectedly. It is also useful for creating utilities that act like standalone native operating system commands but which require the A-Shell environment.

As an example of the latter, imagine a Unix shop where the system administrator wants to be able to check on the status of A-Shell sessions, but doesn’t want to otherwise know anything about A-Shell (how to launch or terminate it.) You could create a shell script (call it "ashstat") that contained the following command:

ashell -e do astat

This would execute dsk0:astat.do[2,2], which would log the user in and then launch ASTAT, something like:

:R

LOG OPR:

ASTAT

 

Note that if input is piped into the ashell command by redirecting standard input, then the -e switch is assumed, and may not be overridden.

The other way to auto-terminate an A-Shell process on the completion of a command is to have the command chain to HOST.LIT (if it is an ASB program), or to use a CMD or DO file that ends with the HOST command. In the ASTAT example above, you could have eliminated the –e switch from the ashell command line and instead added HOST to the end of the astat.do file. However, the –e switch is more convenient and more robust, since there is no way to accidentally get around it via some kind of program abort.