home *** CD-ROM | disk | FTP | other *** search
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Hints and Tips for
-
- SKsh
-
- A ksh-like Shell for the Amiga
-
- Version 1.2
-
-
- (Copyright) 1989
-
- Steve Koren
-
- November 19, 1989
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Making SKsh Resident
-
- SKsh version 1.1 or later can be made resident. Add a line
- like this to your startup-sequence:
-
- c:resident sksh
-
- where 'sksh' is the path to the sksh command itself. Then,
- when SKsh is run through a shell-window, the resident SKsh
- will be used, not the disk-based SKsh.
-
-
- Starting SKsh with 'newcli' or 'newshell'
-
- The 'newcli' or 'newshell' commands can be made to
- automatically start SKsh when a new CLI window is generated.
- There are two things that need to be done for this. First,
- define an alias like this:
-
- alias newcli='$(which newshell) CON:0/0/640/200/SKsh_Window'
-
- Also, you must create a s:Shell-Startup file which runs SKsh.
- Mine looks like this:
-
- Prompt "%N.%S> "
- sys:bin/setfont source 10 window
- stack 16000
- sksh
-
- You may have to change this if you do not have the 'setfont'
- command or do not have it installed in 'sys:bin'. The
- 'newcli' command will now start up a new window, with the
- given size, and run SKsh for you automatically using the
- resident 'SKsh'. To make the 'exit' command in SKsh destroy
- the window when SKsh exits, put the following in your .skshrc
- file:
-
- LOGOUT='endcli'
-
- Now, the 'newcli' alias can be used transparently with SKsh.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- SKSH Amiga Shell Page 2 Hints and Tips
-
-
-
-
-
-
-
-
-
-
- Setting up a man-page Directory
-
- To set up a man-page directory, create one in a suitable
- place, and assign the MAN: device to point to it in your
- startup-sequence, like this:
-
- assign MAN: sys:usr/man
-
- The following function can be used to show man-pages:
-
- function man {
- if [ ! -f "MAN:$1.MAN" ]
- then
- echo "No manual entry for $1"
- else
- more "MAN:$1.MAN"
- fi
- }
-
- (You can also remove the function begin and end lines and use
- it as a script with the 's' bit set). Many public domain
- programs come with a "README" or .DOC file which explains how
- to use the program. Copy these into the MAN: directory and
- rename them to prog.MAN. Then, you can use:
-
- man prog
-
- to display the documentation file. This is a simple example,
- but it could be extended to, for example, uncompress
- compressed files before viewing for prog.MAN and prog.MAN.Z.
- You could also extend it to use a pager defined by a $PAGER
- variable. Just replace 'more' with $PAGER.
-
-
- Forcing execution as a program
-
- The 'force' keyword will only force execution as a builtin,
- alias, or function. To force execution as an external
- program, simply use:
-
- $(which prog) args
-
-
- Using c:getenv to read environment variables
-
- A problem with Lattice C currently prevents SKsh from properly
- reading the value of AmigaDos environment variables. However,
- they can still be read using:
-
- my_var=$(c:getenv my_var)
-
-
-
-
-
- SKSH Amiga Shell Page 3 Hints and Tips
-
-
-
-
-
-
-
-
-
- Re-sourcing the .skshinit file
-
- If you source the .skshinit file after you start SKsh, any
- options you have set in your .skshrc file will potentially be
- overridden. One example of this is the 'e' option. The
- .skshinit file sets it, which disables command line editing.
- It is reset in the .skshrc file. If you source the .skshinit
- file again without sourcing the .skshrc file, you will have to
- reset this option flag manually.
-
-
- Using ^r for reverse searches
-
- The SKsh usage of ^r for reverse searches is different than
- the ksh usage. In ksh, you type ^r, which is echoed, the text
- you wish to search for, and then return. In SKsh, you type
- the text you wish to search for, followed by ^r. I have found
- this usage more convienent.
-
-
- Changing default command options
-
- To change the default command options for a particular
- command, define an alias of the same name which uses the
- 'force' keyword. For example, to change the 'cp' command so
- that it uses the 'clone' option and echoes file names as they
- are copied, put the following alias in your .skshrc file:
-
- alias cp = 'force -b cp -cv'
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- SKSH Amiga Shell Page 4 Hints and Tips
-
-
-
-