|
#!/bin/nsh -f
or #!/usr/bin/env nsh -f
) in executable netlets called directly at the Unix prompt. If the non-interactive nsh shell is invoked (without -f <filename> or --<application name>
) then for ?
or help
commands the user is presented with the following help info:
|
pwd |
Path of working directory |
cd |
Change directory; the "~" character can be used, this will change back to the nsh shell's home directory |
ls |
Directory listing of the current working directory |
dir |
Synonomous with the ls command |
Environment
chgrp |
Change discovery/lookup groups for this shell |
chport |
Change a port of a given lookup service in the network |
disco |
For browsing and inspecting lookup services in the network |
groups |
Show the nsh shell groups |
lup |
For browsing finding and inspecting services in the network |
start |
Strarts SORCER and user defined services |
stop |
Destroys the selected lookup service or all of them |
clear |
Removes all fetched shell's resources or a selected service provider, exert monitor, or exertion |
edit |
Opens the editor specified by $NSH_EDITOR or by the application name 'editor' in the shell initialization file nsh-init.config |
exert |
Manages and executes the federation of services specified by the input file |
gvy |
Execute a Groovy script in a given file |
help |
Lists all shell commands and describe each of of them |
http |
Starts and stops Webster instances. |
info |
Shows this shell properties; details are shown for the current user, time logged in, the http server, selected registrar, exert monitor and, (-a) information on applications that can be started by this shell. |
mxe |
For monitoring executing exertions in the network |
mxm |
For monitoring modeling services in the network |
!! |
Runs the previous command again |
exert
commnad). If a Webster instance is not desired, use the
-noHttp optionIf you are running the nsh on OS X (or other unixes) to use your up & down arrows for command line retrieval, install rlwrap. The SORCER nsh script calls rlwrap when installed. You can create a symblolic link in your $HOME/bin directory ln -s ${SORCER_HOME}/bin/shell/bin/nsh ./nsh rlwrap is a readline wrapper, a utility that allows the editing of keyboard input for any other command. If not installed, open the terminal and type: |
Configuring
the nsh shell
The nsh shell startup script can be specifued by the environmt variable NSH_STARTUP
or by $HOME/.nsh/startup
.
User defined classes for the shell can be specified by the environment variable CLASSPATH
or in a shell start configuration. The nsh start configuration file can be specified by the environmt variable NSH_CONF
or by $HOME/.nsh/configs/nsh-start.config
; the default file is $SORCER_HOME/bin/shell/configs/nsh-start.config
.
The default shell initialization file $SORCER_HOME/bin/shell/configs/nsh-init.config
is used if present. Alternatively an initialization file (with the config
extention) can be passed as the first argument to the nsh or placed in $HOME/.nsh/config
s. The nsh initialization file supports the following configuration entries, with component sorcer.tools.shell.NetworkShell
.
Type: |
String[] |
Default: |
new String[] { "browser", "browser/bin/service-browser-run.xml", ... }; |
Description: |
This entry will be read at initialization by the nsh shell to determine the initial set of related applications (for each application its name and path). |
Type: |
String[] |
Default: |
{@link
net.jini.discovery.DiscoveryGroupManagement#ALL_GROUPS} |
Description: |
This entry will be read at initialization by the nsh shell to determine the initial set of multicast discovery groups the nsh should participate in. |
Type: |
int |
Default: |
0 |
Description: |
The port that Webster should
be started with. Using the default port (0), Webster is started with an
anononous port |
Type: |
String[] |
Default: |
new String [] { "$SORCER_HOME/lib/sorcer/lib-dl", "$SORCER_HOME/lib/river/lib-dl", $SORCER_HOME/lib/rio/lib-dl"
} |
Description: |
An array documenting the directories to serve code from. |
Type: |
String[] |
Default: |
new String [] { } |
Description: |
An array documenting the classes to be exported from jar files (codebase). |
Type: |
{@link
net.jini.core.discovery.LookupLocator}[] |
Default: |
null |
Description: |
This entry will be read at initialization by the nsh shell to determine the initial set of specific lookup services the nsh should register with. |
Type: |
boolean |
Default: |
false |
Description: |
The entry is read at
startup, if set to true, then a Webster instance will not be created by
the nsh shell. Not that this entry renders the httpPort and httpRoot entries
useless |
Type: |
String |
Default: |
$SORCER_HOME/bin/shell/logs |
Description: |
The entry is read at startup to create the shell log file for System.err when the shell is noninteractive. |