Top
||
Section Contents
||
Permuted Index
SavaJe OS
1.1.0
lsh command line shell
com.savaJe.os.shell.lsh [-win]
lsh
is the
SavaJe
command-line shell. It executes commands read from
standard input.
The shell contains a simple history mechanism, summarized below.
/
|
repeat the last shell command |
/d
|
dump a numbered list of shell command history |
/ num
|
repeat the command associate with num |
-win
|
create shell in a separate window |
When you run commands from the shell prompt, they can be followed by an optional action.
; |
run the command in the foreground (the current thread). This is the default action. |
& |
run the command in the background (in a separate thread) |
> file |
redirect the standard output of the command to file |
You can execute shell commands in a file (scripts) by using the source(shell) command.
You can have lsh
execute a startup file by setting the property
savaJe.lsh.startup
in the file
/ramfs/users/
, which gets read when the user username
/savaJe/user.propsusername
logs in.
For example, the following line in user.props
would cause the
script startup.lsh
to be run when an lsh
starts:
savaJe.lsh.startup=startup.lsh
The following example executes two commands in
succession: first, print a long listing of the files
in the current directory to the file
ls.txt
(in the current thread).
When that is done print the
contents of ls.txt
to standard output.
lsh% ls -l > ls.txt; cat ls.txt
The following example runs the application found in
BigApp.jar
on the http server
someserver
in a separate thread so that the shell
prompt returns immediately.
lsh% run http://someserver/BigApp.jar &
The next example starts a new shell in a separate window.
lsh% com.savaJe.os.shell.lsh -win &