Index

Man Page for capshell

NAME
  capshell

DESCRIPTION
  Provide command line access to the CapServer. Note that a general
  overview of all available commands can be obtained by the cmds
  command within the CapShell.

INVOCATION
  The CapShell is invoked using a standard cm command, for example
     bin/cm capshell
  A number of parameters can be passed to this command:

   -n    No login upon startup
   -i    Read stdin from this file
   -o    Use this file as stdout
   -j    Don't search for/use Readline/Editline
   --bsh Run in beanshell mode
   --gui Run a swing shell (you don't want this, it's experimental!)

  Also a login connection string can be passed:

   cm capshell admin/admin

  If not specified, the shell will prompt for username and password.

  After login, the CapShell will read in all persistent environment 
  parameters and aliases automatically.

CONNECTION STRINGS
  Connection strings are defined as such:

    http://domain.user/name@host:port/coremedia/ior

  whereby the prefix http:// and postfix /[coremedia|workflow]/ior are 
  optional. The domain is also optional. Hence the following forms are also valid

    user/name        (host and port taken from last login or capclient.properties)
    domain.user/name
    @http://myserver:44441/coremedia/ior  (user/password taken from environment)

  The shell commands connect and wfconnect can connect/reconnect) create new
  sessions without leaving the shell.

GRAMMAR
  There is no defined grammar yet. However, the following might help
  you understand how commands are parsed and executed.

  Simple Commands

   Simple commands are a sequence of words terminated by a control
   character, this being either a semicolon ';' or a return character. 

   The return value of a simple command is its exit status. It can be
   retrieved via the environment variable $? after command completion

  Pipelines

    A pipeline is a sequence of one or more commands separated by the 
    character |. The format for a pipeline is:

        command [ | command2 ... ]

    The standard output of command is connected to the standard input 
    of command2.

COMMENTS
  A word beginning with # causes that word and all remaining characters 
  on that line to be ignored.  

QUOTING
  Quoting is used to remove the special meaning of certain characters or words
  to  the shell.  Quoting can be used to disable special treatment for special
  characters, to prevent reserved words from being recognized as such, and  to
  prevent parameter expansion.

  There are two quoting mechanisms: the escape character, and double quotes.
  (Single quotes are not yet implemented).

  A non-quoted backslash (\) is the escape character.

PARAMETERS
  Special Parameters
    The shell treats several parameters specially.  These parameters may only be
    referenced; assignment to them is not allowed.
      ?  Expands to the status of the most recently executed foreground
         pipeline.

  Shell Variables
  The following variables are set by the shell:
    login.username   The username of the current connection to a capserver
    corem.login.ior  The ior of the current connection to a capserver
    login.password   The password of the current connection to a capserver
    LINES_PER_PAGE   Number of lines per page for the more command
    SHELL_VERSION    Current Shell version
    ?                Exit status of the last command
    CURDIR           Current directory
    SHOW_STACKTRACES Show error stack traces
    COMMAND_TIMER    Show execution time of calls
    DEBUG            [on|off] Show all kinds of debug info [development only] 
    EXPERT_MODE      [on|off] Disables sanity checks. CAREFUL!!!!
    PATTERNMATCHER   [awk|perl] Default Perl5 (see Oromatcher documentation)

EXPANSION
  Expansion is performed on the command line after  it  has  been  split  into
  words. There are multiple types of expansion: tilde expansion, pathname expansion, 
  and variable expansion.

  Pathname expansion can only be used with the editline/readline integration.

  The order should be the following:
   1. Variable expansion
   2. Tilde expansion
   3. Resourcename expansion

  Tilde Expansion 
    The tilde (~) is expanded to the current user's home directory.

  Resourcename Expansion
    Resourcenames are expanded/interpreted in the following order:

        * The resource name relative to the current folder
          (e.g. ls foo)
        * The resource name with absolute path
          (e.g. ls /Home/admin/foo)
        * The resource name using regexes (the shell uses jakarta oromatcher)
          (e.g. ls /H*/me/La[0-9]+*)
        * The resource id
          (e.g. ls 99)

  Variable Expansion
    Environment variables are expanded in the command line if they are
    specified with $var or ${var} and not escaped.

ALIASES
  Aliases  allow  a string to be substituted for a word when it is used as the
  first word of a simple command.  The shell maintains a list of aliases  that
  may  be set and unset with the alias and unalias builtin commands (see SHELL
  BUILTIN COMMANDS below).

EXIT STATUS
  For  the shell's purposes, a command which exits with a zero exit status has
  succeeded.  An exit status of zero indicates success.  A non-zero exit  sta­
  tus  indicates failure.  

PROMPTING
  When  executing  interactively, CapShell displays the primary prompt PS1 when 
  it is ready to read a command. CapShell allows these prompt strings to be cus­
  tomized by inserting a number of percent-escaped special characters that
  are decoded as follows:

    ~   Current directory
    %h  Hostname
    %u  User
    %m  Expert Mode on?
    %t  Servertype (live/prod/slave)
    %v  CapShell version
    %!  History number of the current command

  Colorization
    Full ANSI colorization is supported assuming a compatible terminal.
    The escape character is defined to be [33

    Example:

      set PS1="[33[1;41;32m%u[33[1;44;36m@%h[33[0;47;30m:~[33[m # "

  Persistence 
    Using the config layer, the prompts for an admin-shell and a regular
    user shell can be permanently defined using the commands:

      config set general/ROOTPROMPT="myprompt"
      config set general/PROMPT="myprompt"

READLINE
  CapShell interfaces with java readline (java-readline.sourceforge.net). 
  Follow their website for instructions on installing the native part of the
  code. CapShell recognizes the existence of this software automatically,
  there is no configuration necessary. Under Debian GNU/Linux you can just
  get the packages via apt-get. 

HISTORY
  The shell also provides the well known history mechanism:
   !!        Refer to the last command 
   !string   Refer to the last command starting with string
   !number   Refer to the command with this history number (see history command)

SHELL BUILTIN COMMANDS
  alias [-s] [name[=value] ...]
      Alias with no arguments prints all defined aliases. aliases in the 
      defines name=value. The option -s stores all defined aliases persistently .
      
  cd  [dir]
      Change the current directory to dir.
  cmds
      Show a list of all registered commands
  dirs 
      Without options, displays the list of currently  remembered  directo­
      ries. 
  echo [-n] [arg ...]
      Output the args, separated by spaces, followed by a newline. If -n is
      defined, no newline is printed.
      
  exit [n]
      Cause the shell to exit with a status of n.  If  n  is  omitted,  the
      exit  status is that of the last command executed.  

  history 
      With no options, display the command history list with line numbers.

  popd 
      Removes entries from the directory stack.
  pushd 
      Adds  a  directory  to the top of the directory stack
  pwd 
      Print  the  absolute  pathname of the current working directory.
  set [name[=value]]
      Without options, the name and value of each shell variable  are  dis­
      played in a format that can be reused as input. Otherwise environment
      variable with the given name is set to the value.
  unalias [name ...]
      Remove each name from the list of defined aliases.

AUTHOR
  Written by JochenT.

REPORTING BUGS
  Report bugs to <jochen@jtoee.com>.

COPYRIGHT
  Copyright © 2004 JTOEE.