Managing programs and files
Slush provides a rich set of commands for manipulating files, file permissions and the slush directory hierarchy. Slush commands do not understand wildcards like *.tini. Actually * is a valid character in a slush filename, as are a number of other special characters that would not be legal in Windows or Linux (* ? $ # @, to name a few). Remember, in order to keep the memory size of slush small, it is a very small implementation of a Unix/Linux-like shell.
All of the commands are implemented in a very minimal way. Slush allows you to redirect program input/output from commands, as well as running Java programs in the background, very much in the same way as you would with Unix/Linux.
Use the “<” symbol to redirect input from a file, the “>” symbol to redirect output to a file, the “>&” symbols to redirect stdout and stderr to a file, and “&” to run a Java program in the background. Running slush commands in the background other than the Java command is not currently supported. For example, to run the program myProg.tini in the background and redirect the output to a file named runlog.txt, use the following command:
TINI/ > java myProg.tini > runlog.txt &
In addition to redirecting output to a file, you can redirect output to the null device (for example, java test.tini > null) if you want to suppress the output from a Java program, or redirect the output to the serial port (java test.tini > S0). S0 indicates the TINI serial port named “serial0” and is currently the only port supported for redirection to a port. You must have admin privileges to redirect to the serial0 port, and should not do this if you are already at a serial server prompt (as you are when you log in through JavaKit or a Terminal emulator) because slush will stop the serial server before running the command and then bring it back up after the com- mand is complete. All of the slush commands are summarized in the following tables. Brackets (“[ ]”) around some of the command options means that these parameters are optional.
Slush offers a minimal set of commands for managing users, but enough to get the job done.
We will discuss the ipconfig command in a bit more detail in Chapter 13.
The slush FTP client supports the following commands:
open ARG : Opens the FTP server at address ARG
user [ARG] : Logs in as user ARG
bin : Changes to binary transfer mode
ascii : Changes to ASCII transfer mode
list : Lists the files in the current directory
pwd : Lists the full path of the current directory
cd ARG : Changes the current directory to ARG
get ARG : Gets the file ARG from the server
put ARG : Puts the file ARG on the server
exit, bye, quit : Quit
Miscellaneous slush commands
This is a list of some of the miscellaneous commands that didn’t neatly fit into one of
the previous categories.
Table 7-5: Slush miscellaneous commands