home *** CD-ROM | disk | FTP | other *** search
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Hints and Tips for
-
- SKsh
-
- A ksh-like Shell for the Amiga
-
- Version 1.7
-
-
- (Copyright) 1988-1991
-
- Steve Koren
-
- May 4, 1991
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 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 automati-
- cally 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:
-
- setfont source 10 window
- sksh -S
-
- You may have to change this if you do not have the 'setfont'
- command or do not have it installed in 'sys:bin'. The 'new-
- cli' 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.
- A similar mechanism can be used with MachII or other utilities
- which let you define a hotkey which will create a new shell
- window. Simply replace "newcli" with:
-
- c:newshell CON:0/0/600/180/SKsh_Window
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- SKsh Amiga Shell Page 2 Hints and Tips
-
-
-
-
-
-
-
-
-
-
-
-
-
- Forcing execution as a program
-
- The 'force' keyword will only force execution as a builtin,
- alias, or function. To force execution as an external pro-
- gram, simply use:
-
- $(which prog) args
-
-
- Re-sourcing the .skshinit file
-
- If you source the .skshinit file after you start SKsh, any op-
- tions 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 com-
- mand, define an alias of the same name which uses the 'force'
- keyword. For example, to change the 'rm' command so that it
- echoes file names as they are deleted, put the following alias
- in your .skshrc file:
-
- alias rm = 'force -b rm -v'
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- SKsh Amiga Shell Page 3 Hints and Tips
-
-
-
-
-
-
-
-
-
- File name completion hints
-
- The <esc>= command can be used to list all file names in a
- given directory. If the previous word ends in a slash, <esc>=
- will list each file in the directory:
-
- [dh0:]: more ram:test/
- (press <esc>=)
- 1) ram:test/file1.txt
- 2) ram:test/file2.txt
- 3) ram:test/my_file.txt
-
-
- Maximum command line length
-
- Command lines which are passed to external functions are
- limited in length by AmigaDos to 255 characters. Alias
- substitions are limited in length by SKsh to 1023 characters;
- lines longer than that will generate a syntax error. However,
- SKsh builtins can operate on any number of arguments.
- Therefore, a "dir foo:*" might generate a syntax error if a
- very large number of files are matched. In these cases (which
- should be rare) the builtin form of the alias (in this case,
- "ls") will operate correctly since there are no length
- limitations.
-
- You can circumvent the external command length limitation
- through the use of the xargs command.
-
-
- Bypassing Internal Commands
-
- If a name is interpreted by SKsh as a builtin, alias, or
- function, but is also an external command, starting the name
- with a capital letter will force SKsh to use the external
- command. SKsh internal commands are case sensitive, while
- external binaries are not. For example, using a lower case
- "dir" normally invokes the SKsh alias of that name. However,
- using "Dir" will invoke the AmigaDos command provided that it
- is in your search path. The builtin form of the command can
- also be unaliased or unset.
-
-
- Making Commands Resident
-
- There are several different resident command standards avail-
- able under AmigaDos. SKsh uses the ARP method, and will "see"
- resident commands added to that list (which the SKsh resident
- command will do). If commands are added to another resident
- list, SKsh will use the disk based form of the command.
-
-
-
-
-
-
- SKsh Amiga Shell Page 4 Hints and Tips
-
-
-
-
-
-
-
-
-
- Using the mplist command
-
- The mplist is simply a generic mechanism for mapping any argu-
- ment to any other string. For example, you may wish to abbre-
- viate the name of a directory so that instead of typing:
-
- cd sys:usr/commands/src/cmd1/directory-one
-
- you can type:
-
- cd d1
-
- To do that, add the following line to your .skshrc file:
-
- mplist -a 'd1=sys:usr/commands/src/cmd1/directory-one'
-
- Any reference to the unquoted string d1 will be replaced with
- the directory name.
-
- The destination string does not have to be a directory name.
- It can be any string.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- SKsh Amiga Shell Page 5 Hints and Tips
-
-
-
-