shell5-utils (c) Andrew Flegg 2001. Released under the ~~~~~~~~~~~~ Artistic Licence. http://www.bleb.org/software/pda/ v0.04 (01-May-2001) mailto:andrew@bleb.org Introduction ------------ Nik Murray's Shell5[1] is a UNIX-like shell for EPOC machines, but is limited by it's EXE support. With the release of a SysRAM1.opx[2] that supports command line arguments for EXEs from OPL, I wrote some wrapper scripts for the most useful EXEs available on EPOC: Java and Perl. Once installed, compiling java simply becomes a matter of putting 'alias javac "java sun.tools.javac.Main"' in your autoexec.bat (assuming you have the JavaC classes[3]). X-Soft's FTP.opx[4] has facilitated the addition of a simple FTP client, more details below. The package ----------- The following commands are available: emacs, java and perl. These are implemented using OPL and so need to be put in a directory in your Shell5 path. Mine are in D:\Programs\Shell5 and my autoexec.bat contains: "set path=$path$,D:\Programs\Shell5". Each command consists of 3 files: .opl OPL tokenised version of the command .opo Translated "binary" run by Shell5 .txt Text version of the OPL for looking at away from an EPOC device. Only the .opo is necessary for use, but the .opl is necessary if you want to change the commands (eg. executable location etc.) Changing the location of the executables is easily done by opening the OPL file, changing the path at the top of the file and re-translating it. The commands ------------ emacs: A simple wrapper for Symbian's Text Editor[5] which will create a file if necessary. Specifying "&" will move Shell5 back to the foreground immediately after opening the editor. Syntax: emacs [&] ftp: A basic FTP comand line FTP client. Implements most basic commands such as "get", "put", "cd", "rename", "lcd", "lls", etc. A list of commands can be obtained by typing "help". Both DOS and UNIX aliases are available: ie. "ls" and "dir". If a user is not specified on the command line then the client will try to connect as "anonymous", providing the email address specified at the top of the source. This should be changed to your own email address and will, in future, be read in from an environment varible. Known bugs: the "pwd" command doesn't work due to a bug in the OPX Syntax: ftp [-l ] java: A straightforward wrapper which builds up a command line and passes it on to java.exe (installed in C:\System\Programs\ on my machine). If the -cd option is not specified (an option specific to the EPOC Java port) then this is automatically added for the current Shell5 directory. Directories should be separated by ',' rather than ';' within the '-cp' option. Syntax: java [&] E.g. : java sun.tools.javac.Main Foo.java java Foo & java -cp D:/Programs/Java/,D:/Java/ext.zip Wibble perl: A more "interesting" wrapper: the Perl port does not support an equivalent of '-cd' (see Java), and so the wrapper looks for files in the current directory which exist as arguments and prepend them with the current Shell5 directory. THIS COULD CAUSE STRANGE ERRORS IF A PARAMETER WHICH SHOULD NOT BE CHANGED EXISTS IN THE CURRENT DIRECTORY. The wrapper also handles input/output redirection using temporary files, these temporary files will not be deleted if the program is put into the background. Also, -e is not supported well as Shell5 splits the arguments and removes the quotes which are usually used with -e - I can see no algorithm for rebuilding these so all Perl programs should be implemented in a file. Also, I can't find a way of terminating stdin on the console, so be prepared to kill Perl if necessary - remembering to redirect stdin next time! Finally, Shell5 (or EPOC) wants CRLF line endings, whereas Olaf's Perl port uses straigh LF. This is now handled transparently with appropriate conversions depending on whether it's input or output. This functionality can be disabled with the new `--raw' option. Syntax: perl [--raw] [] [&] E.g. : perl test.pl >test.output ls -l | perl mygrep.pl ^d | wc echo "Perl on EPOC" | perl banner.pl -w 40 The future ---------- I've had encouraging results using Perl and PPT[6] with 'banner', 'grep' and 'printenv'. 'ping' didn't work and 'printenv' didn't output anything (EPOC doesn't support an environment so no output is to be expected!) I imagine a wrapper for Python would be useful (though I don't use it myself), and other executables like EiC and BZip2[7]. I'm also interested in getting most of a POSIX environment there by using PPT wherever possible. Reducing the overheads in starting the wrappers would be good, though I don't know if this is especially possible. References ---------- 1) Shell5, http://www.geocities.com/SiliconValley/Pines/1439/shell.html 2) SysRAM1.opx, http://www.symbiandevnet.com/downloads/opl/projectopx/projectopx_rel.htm 3) Compiling Java, http://www.davies.lu/Java/ 4) FTP.opx, http://www.x-soft.cz/ftp_opx_en.htm 5) Editor, http://www.symbiandevnet.com/downloads/sdks/er5sdks.htm#updates 6) Perl Power Tools, http://language.perl.com/ppt/ 7) EiC and BZip2, http://www.ime.usp.br/~ueda/psion/eic.html Changes ------- 0.04 01-May-2001 FTP: Included in the archive 0.03 24-Dec-2000 Java: Handles -cp directory separators 0.02 11-Dec-2000 Perl: Fixed I/O problems - now more useful... 0.01 07-Dec-2000 Initial release. Barely functional ;-) Comments/Licence ---------------- Comments/feedback/modifications/updates welcome. Please mail them to me at mailto:andrew@bleb.org. These programs are released under the Artistic Licence, see below for more details: http://www.opensource.org/licenses/artistic-license.html