Package COM.INFORMATIMAGO.TOOLS.SCRIPT

undocumented

*program-name*
variable
Name of the program.
If available we use the actual program name (from *LOAD-PATHNAME*),
otherwise we fallback to *PROGRAM-NAME*.
Initial value: PROGRAM-NAME
*shell-error*
variable
The stream where the error  stream of the shell commands is set to.
Initial value: #<SYNONYM-STREAM to *ERROR-OUTPUT* #x302001F6E55D>
*shell-output*
variable
The stream where the output stream of the shell commands is set to.
Initial value: #<SYNONYM-STREAM to *STANDARD-OUTPUT* #x302001F6E7BD>
*verbose*
variable
Adds some trace output.
Initial value: NIL

CALL-OPTION-FUNCTION

CONCAT

(define-option names parameters &body body)
macro
DO:         Define a new option for the scirpt.
NAMES:      A list designator of option names (strings
            such as "-a" "--always").
PARAMETERS: A list of option parameters.  The names of
            these parameters must be descriptive as they
            are used to build the usage help text.
BODY:       The code implementing this option.
RETURN:     The lisp-name of the option (this is a symbol
            named for the first option name).
ex--base
constant
base value for error messages
Initial value: 64
ex--max
constant
maximum listed value
Initial value: 78
ex-cantcreat
constant
can't create (user) output file
    A (user specified) output file cannot be created.
Initial value: 73
ex-config
constant
configuration error
Initial value: 78
ex-dataerr
constant
data format error
    The input data was incorrect in some way.
    This should only be used for user's data & not
    system files.
Initial value: 65
ex-ioerr
constant
input/output error
     An error occurred while doing I/O on some file.
Initial value: 74
ex-nohost
constant
host name unknown
    The host specified did not exist.  This is used
    in mail addresses or network requests.
Initial value: 68
ex-noinput
constant
cannot open input
    An input file (not a system file) did not
    exist or was not readable.  This could also include
    errors like "No message" to a mailer (if it cared
    to catch it).
Initial value: 66
ex-noperm
constant
permission denied
    You did not have sufficient permission to
    perform the operation.  This is not intended for
    file system problems, which should use NOINPUT or
    CANTCREAT, but rather for higher level permissions.
Initial value: 77
ex-nouser
constant
addressee unknown
    The user specified did not exist.  This might
    be used for mail addresses or remote logins.
    
Initial value: 67
ex-ok
constant
successful termination
Initial value: 0
ex-oserr
constant
system error (e.g., can't fork)
    An operating system error has been detected.
    This is intended to be used for such things as "cannot
    fork", "cannot create pipe", or the like.  It includes
    things like getuid returning a user that does not
    exist in the passwd file.
Initial value: 71
ex-osfile
constant
critical OS file missing
    Some system file (e.g., /etc/passwd, /etc/utmp,
    etc.) does not exist, cannot be opened, or has some
    sort of error (e.g., syntax error).
Initial value: 72
ex-protocol
constant
remote error in protocol
    the remote system returned something that
    was "not possible" during a protocol exchange.
Initial value: 76
ex-software
constant
internal software error
    An internal software error has been detected.
    This should be limited to non-operating system related
    errors as possible.
Initial value: 70
ex-tempfail
constant
temp failure; user is invited to retry
    temporary failure, indicating something that
    is not really an error.  In sendmail, this means
    that a mailer (e.g.) could not create a connection,
    and the request should be reattempted later.
Initial value: 75
ex-unavailable
constant
service unavailable
    A service is unavailable.  This can occur
    if a support program or file does not exist.  This
    can also be used as a catchall message when something
    you wanted to do doesn't work, but you don't know
    why.
Initial value: 69
ex-usage
constant
command line usage error
    The command was used incorrectly, e.g., with
    the wrong number of arguments, a bad flag, a bad
    syntax in a parameter, or whatever.
Initial value: 64
(find-directories rootpath)
function
Return a list of recursive subdirectories starting from ROOTPATH
that are accessible by the user.

MAPCONCAT

PARSE-OPTIONS

(program-name)
function
This function can be used to set *program-name* in the main script.

REDIRECTING-STDOUT-TO-STDERR

(shell control-string &rest arguments)
function
Formats the COMMAND with the ARGUMENTS and
synchronously execute the result using a Bourne-compatible shell,
with standard output to *SHELL-OUTPUT*, and standard error to *SHELL-ERROR*.
Returns the shell's exit code.
(shell-quote-argument argument)
function
DO:      Quote an argument for passing as argument to an inferior shell.
RETURN:  A string containing the quoted argument.
(uname &rest options)
function
Without OPTIONS, return a keyword naming the system (:LINUX, :DARWIN, etc).
With options, returns the first line output by uname(1).