1871
|
1 88/10/12 19:42 Shell+ V2.1 Page 001
|
|
2
|
|
3
|
|
4
|
|
5 Hacked Shell+ v2.1 Documentation
|
|
6 For L-II CoCo-3 Only
|
|
7
|
|
8 By: Ron Lammardo
|
|
9
|
|
10
|
|
11
|
|
12 BUG FIXES:
|
|
13
|
|
14 Will now unload (unlink) the correct name. Previously, if the module name
|
|
15 did not match the command filename you typed, shell would not unload the
|
|
16 module, and it would stick in memory until manually unlinked. This shell
|
|
17 reads in the actual module name and uses it instead of whatever was on
|
|
18 the command line. Example: "/d0/cmds/bob" will work correctly now: the
|
|
19 module name within the "bob" file will be the one to unload.
|
|
20
|
|
21 To prevent attempted execution of a write-only device as a procedure file,
|
|
22 and to help with use of L-II window startup, this shell checks modes and
|
|
23 attempts write of a null to std out when shell starts up.
|
|
24
|
|
25 You can redirect >>> to a write-only device. Before this, the shell would
|
|
26 open the path in UPDATE mode.
|
|
27
|
|
28 The quote bug is fixed. That is, leaving off the second quote mark in lines
|
|
29 like - format /d0 r "Disk - will not crash the shell.
|
|
30
|
|
31 The EX bug is fixed..if you type 'EX' with no parameters (to kill a shell)
|
|
32 it will not attempt to fork any module or return an error to the parent
|
|
33 process.
|
|
34
|
|
35 Standard error path is now 'un-redirected ' after using a pipe.
|
|
36
|
|
37
|
|
38
|
|
39 ADDITIONS:
|
|
40
|
|
41 NOBLOCK
|
|
42 -------
|
|
43
|
|
44 The shell now runs in what is commonly called 'No Block Mode'. Under previous
|
|
45 versions of shell / shell+ if you had a shell running on , say, T2 and you were
|
|
46 running on Term there was no convenient way to send messages back and forth. If
|
|
47 you did an 'echo whats new >/t2' from the Term it would wait around until
|
|
48 the other shell recieved keyboard input. While it was waiting, Term would be
|
|
49 hung up waiting for the echo command to complete. This problem was caused by
|
|
50 the other shell doing a read call, thereby 'blocking out' any other input.
|
|
51
|
|
52 This release of Shell+ gets around that problem by putting itself to sleep
|
|
53 while waiting for keyboard input, allowing other input to get through &
|
|
54 display. Once the first key is hit for a line, the shell goes into its regular
|
|
55 read routine until the <ENTER> key is pressed.
|
|
56
|
|
57 The noblock feature can be turned off by : modpatch <noblock.off.scr
|
|
58 and then saving the shell.
|
|
59
|
|
60 It can be turned back on by : modpatch <noblock.on.scr
|
|
61 and then saving the shell.
|
|
62
|
|
63
|
|
64 88/10/12 19:42 Shell+ V2.1 Page 002
|
|
65
|
|
66
|
|
67 EXECUTION DIR SCRIPTS
|
|
68 ---------------------
|
|
69
|
|
70 A favorite feature of preliminary shell+ users, this allows global shell
|
|
71 scripts to be placed in your execution (CMDS dir). Simply build or copy
|
|
72 a shell procedure file to your cmds dir, then set the execution permission
|
|
73 bits on it (attr script e pe). This makes it easy to add some commands
|
|
74 that you can access almost all the time.
|
|
75
|
|
76 The shell search path becomes: memory, execution dir modules/scripts,
|
|
77 data dir scripts.
|
|
78
|
|
79 Some people use this for printer setup cmds (using display >/p), others
|
|
80 use it with the IF/THEN/ELSE and GOTO commands to make sophisticated
|
|
81 procedures. I use it a lot for window commands, and program startups.
|
|
82
|
|
83 For example, I have a script in my cmds dir called "fsm". It opens a VDG
|
|
84 screen on W6, and starts Flight Simulator. When I exit FS, it resets W6
|
|
85 back to a window type (all done in the background):
|
|
86
|
|
87 * FSM - Procedure Command File in CMDS that starts FS-II.
|
|
88 xmode /w6 type=1; display c >/w6
|
|
89 chd /dd/games/fs
|
|
90 (fs <>>>/w6; xmode /w6 type=80)&
|
|
91
|
|
92
|
|
93 PROMPTS
|
|
94 -------
|
|
95
|
|
96 Settable and useful prompts. Ron had a great idea: why not add the device
|
|
97 name you're working from to the prompt ( OS9[T2]: )? Loved it, but everyone
|
|
98 liked different method of presentation. So added user-settable prompt:
|
|
99
|
|
100 p=prompt The prompt may be up to 21 chars, extra ignored.
|
|
101 A space, return, or semicolon terminates the prompt.
|
|
102 By putting the prompt in quotes, scan will continue
|
|
103 until second quote, return, or 21 chars is reached.
|
|
104
|
|
105 Options include:
|
|
106 # - show shell's decimal proc id # (00-99).
|
|
107 @ - show device name current std out
|
|
108 $ - show current working directory
|
|
109 ( - show current date
|
|
110 ) - show current time
|
|
111
|
|
112 More than one #,@,$,(,) is ignored.
|
|
113
|
|
114
|
|
115 Examples: Prompt Resulting:
|
|
116
|
|
117 p=OS9/@: OS9/Term:
|
|
118 p="Hi There!" Hi There!
|
|
119 p=OS.#.@: OS.06.T2:
|
|
120 p=$> /d0>
|
|
121 p=") [@]:" 18:30:14 [Term]:
|
|
122 p= <uses default setup in shell header>:
|
|
123
|
|
124
|
|
125
|
|
126
|
|
127 88/10/12 19:42 Shell+ V2.1 Page 003
|
|
128
|
|
129
|
|
130 Default prompt- stored starting from offset $003D in this shell. As it comes,
|
|
131 it's set to 'OS9[@]'. You may set using debug to something else. Terminate
|
|
132 your prompt with a $20 (blank). Offset $0054 is the longest you should go
|
|
133 before you run into the rest of the shell code. The longest settable
|
|
134 prompt will stop at $0051 anyway (21 chars worth).
|
|
135
|
|
136
|
|
137 It's easy to start up new shells with custom prompts. Just pass it as param.
|
|
138 To start a shell on say, /W4 with a special prompt, you might type:
|
|
139
|
|
140 'shell p=OS9/@? i=/w4& ' ... results in shell on W4 with prompt 'OS9/W4?'
|
|
141
|
|
142 However, if you wish to use the # process id option as a shell parameter
|
|
143 like the above, then since #!&; etc normally means something special,
|
|
144 you must put the string in quotes, which are ignored by P=. Thus instead:
|
|
145
|
|
146 'shell p="Hello.#[@]" i=/w4& ' ... gives prompt of 'Hello.07[W4]'
|
|
147
|
|
148
|
|
149 PATH REDIRECTION
|
|
150 ----------------
|
|
151
|
|
152 z={path} - Same as i=/1 except that the parent process is killed. This would be
|
|
153 used in a shellscipt that does a chd,path=,or variable defining that
|
|
154 you want held over when the shellscript ends.
|
|
155
|
|
156 r=[redirect chars]{path} - redirects the specified paths to the input path. All
|
|
157 allowable path mnemonics are supported : <, >, >>,
|
|
158 <>, <>>, <>>>, >>>
|
|
159
|
|
160
|
|
161
|
|
162 Examples:
|
|
163
|
|
164 r=>/w - redirects std out to next available window
|
|
165 r=<>>>/w - redirects std in,std out, std err to next available window
|
|
166 r=</h0/shellscript - redirects std in from /h0/shellscript. If the last
|
|
167 line in the file was 'i=/1' , the shellscript would end
|
|
168 with all settings preserved. This method is preferrable
|
|
169 to the 'z=' or 'GPERE' methods as it does not involve
|
|
170 forking any additional shells.
|
|
171
|
|
172
|
|
173 MEMORY SCRIPTS
|
|
174 --------------
|
|
175
|
|
176 One of the big problems encountered by floppy disk users is 'where did I put
|
|
177 that shell script ?'. The shell will now allow a data module, either resident
|
|
178 in memory or from the execution directory (or from a full path list if
|
|
179 specified) to be executed as if it were a text file containing a shell script.
|
|
180 Using this method, you could convert all your commonly used shellscripts to
|
|
181 data modules (See the DATAMOD utility) , pack them all into one file and load
|
|
182 during startup. This would allow access to all those shellscripts without
|
|
183 accessing the disk. And since shellscripts are generally very small, you should
|
|
184 be able to merge quite a few into an 8K block.
|
|
185
|
|
186
|
|
187
|
|
188
|
|
189
|
|
190 88/10/12 19:42 Shell+ V2.1 Page 004
|
|
191
|
|
192
|
|
193 RUNB BASIC09 PARAMETER SETUP
|
|
194 ----------------------------
|
|
195
|
|
196 A common complaint, and perhaps the reason why more people don't write
|
|
197 packed Basic09 commands, is that Runb requires any passed parameters
|
|
198 to enclosed in parenthesis and quotes. For example, to execute a packed
|
|
199 command, you might have to type: cgp220sd ("/term","/p"). A royal pain.
|
|
200
|
|
201 This shell recognizes packed procedures, and will do this automatically
|
|
202 for you. Using the same example, you can just type: cgp220sd /term /p .
|
|
203 The shell will still recognize parameters passed in the normal format:
|
|
204 cgp220sd ("/term","/p").
|
|
205
|
|
206 I expect this feature to allow the user to go nuts making packed basic09
|
|
207 custom commands. All parameters of course must be strings. If you need
|
|
208 to pass a number, simply take it in as a string and use the VAL command
|
|
209 to convert it to a number.
|
|
210
|
|
211 Here's a quick and dirty program to pack. It allows you to see how things
|
|
212 are passed. Examples:
|
|
213
|
|
214 parmtest 1 2 3
|
|
215 parmtest hello kevin darling
|
|
216 parmtest only two
|
|
217 parmtest more than three params
|
|
218
|
|
219 ------------------------------------------
|
|
220
|
|
221 PROCEDURE ParmTest
|
|
222 PARAM a,b,c:STRING
|
|
223 DIM aa,bb,cc:STRING
|
|
224 ON ERROR GOTO 100
|
|
225 aa=a
|
|
226 PRINT "Param one=*"; aa; "*"
|
|
227 bb=b
|
|
228 PRINT "Param two=*"; bb; "*"
|
|
229 cc=c
|
|
230 PRINT "Param three=*"; cc; "*"
|
|
231 END
|
|
232 100 (* Come here on Param Error *)
|
|
233 PRINT "Less than three params given"
|
|
234 END
|
|
235
|
|
236 ------------------------------------------
|
|
237
|
|
238
|
|
239 LOGGING
|
|
240 -------
|
|
241
|
|
242 The logging feature is toggled by use of the L / -L commands. If logging is on
|
|
243 (default is off) , any non-comment line will be written to log file
|
|
244 /dd/log/uxxx where xxx is last 3 digits of userid prefixed by the date/time the
|
|
245 line was processed. In addition, a line will be written when a shell starts or
|
|
246 terminates (+++START+++ / +++END+++) .
|
|
247
|
|
248 Logging can be turned on permanently by : modpatch <loglock.on.scr
|
|
249 and then saving the shell. To turn it back off (and enable the L / -L
|
|
250 functions) use : modpatch <loglock.off.scr and then save the shell.
|
|
251
|
|
252
|
|
253 88/10/12 19:42 Shell+ V2.1 Page 005
|
|
254
|
|
255
|
|
256 SHELL VARIABLES
|
|
257 ---------------
|
|
258
|
|
259 The shell now supports up to 10 shell variables of up to 80 characters long
|
|
260 each. These variables remain set as long as the shell is running, and can be
|
|
261 used as all or part of a shell command line. The variables are loaded by :
|
|
262
|
|
263 var.1 - accepts up to 80 chars from std err to load variable %1
|
|
264
|
|
265 var.="......." - loads %0 variable with data between quote characters
|
|
266
|
|
267
|
|
268 An example might be a shell script (or MEM script !) used to call the
|
|
269 assembler. Since most programs use the same standard commands, you could set
|
|
270 up a generic script and supply the input when run as in the following:
|
|
271
|
|
272
|
|
273 * Comp - generic assembler call file
|
|
274 prompt Program to ASM :
|
|
275 var.0
|
|
276 var.3="/dd/output"
|
|
277 t
|
|
278 asm #16k %0 L O=/dd/asm/obj/%0 >-%3
|
|
279 errchk <%3
|
|
280 unload %0
|
|
281 load /dd/asm/obj/%0
|
|
282
|
|
283 When this is run, the following output will be executed:
|
|
284
|
|
285 Program to ASM ? - displays on screen
|
|
286 testprog - user types in
|
|
287 asm #16k testprog L O=/dd/asm/obj/testprog >/dd/output
|
|
288 errchk </dd/output
|
|
289 unload testprog
|
|
290 load /dd/asm/obj/testprog
|
|
291
|
|
292
|
|
293 To view all current variables, enter 'var.?' on the command line to produce:
|
|
294
|
|
295 User Variables :
|
|
296 var.0=shell
|
|
297 var.1=
|
|
298 var.2=
|
|
299 var.3=/dd/output
|
|
300 .
|
|
301 .
|
|
302 var.9=
|
|
303
|
|
304 Shell Sub Variables :
|
|
305 var.0=
|
|
306 .
|
|
307 var.9=
|
|
308
|
|
309 To turn off variable expansion, use the '-V' option ('V' turns expansion on).
|
|
310 Note however that variable expansion is performed before a line is processed.
|
|
311 So if you have a line like '-v prog "50%"' the % will still be expanded for
|
|
312 that line, but proceeding lines would not expand variables.
|
|
313
|
|
314
|
|
315
|
|
316 88/10/12 19:42 Shell+ V2.1 Page 006
|
|
317
|
|
318
|
|
319 If a variable is referenced but not defined, no expansion takes place but the
|
|
320 %# is removed from the input line.
|
|
321
|
|
322 As shown in the VAR.? example, there are two sets of variables. The first set,
|
|
323 the User Variables, can be set & examined by the user. The second set, the
|
|
324 Shell Sub Variables, can only be set by a ShellSub. These variables, however,
|
|
325 can be used to load User Variables by specifying them as %%# .
|
|
326
|
|
327 Example : The Sdate shellsub returns the month name in the first shellsub
|
|
328 variable. If we just want to display this on the current line we
|
|
329 could use :
|
|
330
|
|
331 echo The current month is %%0
|
|
332
|
|
333 Or to run something in a certain month :
|
|
334
|
|
335 IF %%0=July
|
|
336 THEN
|
|
337 .
|
|
338 .
|
|
339 ENDIF
|
|
340
|
|
341
|
|
342 There is one additional variable that can not be set by the user. The variable
|
|
343 '%*' will translate to the error code returned by the last line processed.
|
|
344 This is extremly useful in conjunction with the on error command.
|
|
345
|
|
346
|
|
347 INC. / DEC.
|
|
348 -----------
|
|
349
|
|
350 Shell variables can be incremented / decremented by 1 using the inc.# / dec.#
|
|
351 commands. Result will be a 5 digit number, right justified and zero filled. If
|
|
352 you try to inc./dec. a variable containing a non-numeric field it will treat
|
|
353 the initial field as 00000 and act uppon it accordingly.
|
|
354
|
|
355 Values can be in the range of 0 - 65535 rolling over in either direction. If
|
|
356 you attempt operations on a value > 65535 it will roll over.
|
|
357
|
|
358 Examples :
|
|
359
|
|
360 var.0=1 sets to 1
|
|
361 inc.0 sets to 00002
|
|
362 dec.0 sets to 00001
|
|
363
|
|
364 var.8=002 sets to 002
|
|
365 dec.8 sets to 00001
|
|
366 dec.8 sets to 00000
|
|
367 dec.8 sets to 65535
|
|
368
|
|
369
|
|
370 PAUSE
|
|
371 -----
|
|
372
|
|
373 Pause will display a message than wait for key press or mouse click. The
|
|
374 message will be sent from the first non-space to the end of the line.
|
|
375
|
|
376 Example : pause 'Hit any key when ready' <- displays & waits for key/mouse
|
|
377
|
|
378
|
|
379 88/10/12 19:42 Shell+ V2.1 Page 007
|
|
380
|
|
381
|
|
382 WILDCARDS
|
|
383 ---------
|
|
384
|
|
385 Seemed to be one of the most asked for enhancements , so here they are.
|
|
386 Wildcard expansion is performed AFTER variable expansion but before any other
|
|
387 line checking is done. In order for wildcard expansion to take place the first
|
|
388 character on the line must be a colon (':'), otherwise the line will be
|
|
389 processed as is. This option can be reversed (: will prevent expansion) by:
|
|
390 modpatch <wild.on.scr
|
|
391 and then saving the shell. To restore back, use: modpatch <wild.off.scr
|
|
392 and then save the shell.
|
|
393
|
|
394 The following characters are supported :
|
|
395
|
|
396 * - Matches any string of characters
|
|
397 ? - Matches any one character
|
|
398 [a-z] - Matches one character in the range within the brackets
|
|
399
|
|
400 Upper & lower case are treated equally - 'a*' matches ASM , aif.ctl , ...
|
|
401
|
|
402 To pass a wildcard character to a program,quote it by using the '\' chracter
|
|
403 immediately preceeding the desired chracter.
|
|
404
|
|
405
|
|
406 Examples :
|
|
407
|
|
408 FSTAT * - runs FSTAT on every file in the current data dir
|
|
409 FSTAT [c-g]* - runs FSTAT on every file beginning with c thru g
|
|
410 FSTAT she* - runs FSTAT on every file starting with 'she'
|
|
411 FSTAT *.a - runs FSTAT on files starting ending with '.a'
|
|
412 LS a\* - passes 'a*' to LS for wildcard expansion
|
|
413
|
|
414 The expanded buffer size is 2048 characters. If the expanded line size is
|
|
415 greater than this, error #191 will be returned (Buffer size to small).
|
|
416
|
|
417 A utility program 'PARAM' is included in this archive (source and binary)
|
|
418 to reformat an expanded wilcard line. The program takes the parameter line
|
|
419 passed to it and writes it to standard out , one word per line (similar to the
|
|
420 LS command except that wilcard expansion is taking place in the shell).
|
|
421
|
|
422 Example : param she* <-- input
|
|
423 param shell shell.io <-- expanded to by shell
|
|
424
|
|
425 shell <-- output line from PARAM
|
|
426 shell.io <-- " "
|
|
427
|
|
428 If desired, this output could then be piped to a utility requring paramerters
|
|
429 passed one per line (e.g. - param * ! call "copy $ /d1/$"!shell).
|
|
430
|
|
431
|
|
432 OUTPUT APPEND AND OVERWRITE
|
|
433 ---------------------------
|
|
434
|
|
435 Similar to OS9/68000. Great for appending to logs or help files, or merging
|
|
436 modules. Or for using the same temporary filename by overwriting.
|
|
437
|
|
438 >+filename - also >>+ and >>>+. Appends output to end of [filename].
|
|
439
|
|
440 >-filename - also >>- and >>>-. Overwrites contents of [filename].
|
|
441
|
|
442 88/10/12 19:42 Shell+ V2.1 Page 008
|
|
443
|
|
444
|
|
445 IF / THEN / ELSE / ENDIF / FI / CLRIF
|
|
446 -------------------------------------
|
|
447
|
|
448 Condition testing is supported as follows :
|
|
449
|
|
450 IF -Y - read one char from std err : y=TRUE, n=FALSE
|
|
451 IF -F <file> - TRUE if file exists and is a file
|
|
452 IF -R <file> - TRUE if file exists and is readable
|
|
453 IF -W <file> - TRUE if file exists and is writable
|
|
454 IF -E <file> - TRUE if file exists in execution directory
|
|
455 IF -D <file> - TRUE if file exists and is a directory
|
|
456
|
|
457 IF ....<condition>.... where <condition>
|
|
458 IF +###<condition>#### where <condition> is one of the following :
|
|
459
|
|
460 = - TRUE if left side is equal to right side
|
|
461 < - TRUE if left side is less than right side
|
|
462 > - True if left side is greater than right side
|
|
463 <= or =< - True if left side is less than or equal to right side
|
|
464 >= or => - True if left side is greater than or equal to right side
|
|
465
|
|
466 Without the + symbol in front,the two sides of the equation are compared
|
|
467 character by character from left to right,with any unused characters being
|
|
468 translated to nulls for comparison. If the + symbol is present, the two sides
|
|
469 of the equation are right justified and zero filled, allowing for accurate
|
|
470 numeric condition testing. If either side of the equation is greater than 80
|
|
471 characters or the test condition is missing , the command will error. Note that
|
|
472 if error exit is turned off (by the -X command) processing will continue on the
|
|
473 next line as if the IF statement was true.
|
|
474
|
|
475 Examples:
|
|
476 if a=b false if a=b false
|
|
477 if a<=b true if a<>b true
|
|
478 if hello=HellO true if what=what? false
|
|
479 if what<=what? true if what<>what? true
|
|
480 if 09<010 false if 09>010 true
|
|
481 if +09<010 true if +09>010 false
|
|
482
|
|
483 If a condition is true, following lines will be processed until an optional
|
|
484 ELSE is encountered. Lines will be skipped until a ENDIF or FI is encountered.
|
|
485
|
|
486 If a condition is false, following lines will be skipped until an ELSE , ENDIF
|
|
487 or FI is encountered.
|
|
488
|
|
489 The reserved word CLRIF can be used to clear any IF in effect, even if lines
|
|
490 are to be skipped because of a false condition or between ELSE/ENDIF for a
|
|
491 true condition.
|
|
492
|
|
493 If the input line echo option is on ('T'), the word TRUE or FALSE will be
|
|
494 printing following the if statement depending on how the statement evaluates.
|
|
495
|
|
496 The condition being tested may be placed in brackets (e.g. - if [ -y ] ) to
|
|
497 maintain compatability with existing IF utilities.
|
|
498
|
|
499 IF statements can be nested up to 255 deep. The word THEN is optional and will
|
|
500 be ignored if present.
|
|
501
|
|
502
|
|
503
|
|
504
|
|
505 88/10/12 19:42 Shell+ V2.1 Page 009
|
|
506
|
|
507
|
|
508 GOTO
|
|
509 ----
|
|
510
|
|
511 Goto [label] - searches for label from the beginning of the file.
|
|
512 Goto [+label] - searches for label from current file position on.
|
|
513
|
|
514 Label must be an alphanumeric word (up to 40 characters) and must immediatly
|
|
515 follow a '*' comment marker. Label must exactly match the label on the goto
|
|
516 line (upper & lower case are unique).
|
|
517
|
|
518 If a line contains '*\' as the first two characters, any goto in effect will
|
|
519 be cancelled with processing continuing on the line following.
|
|
520
|
|
521
|
|
522 ONERR GOTO
|
|
523 ----------
|
|
524
|
|
525 Onerr goto [label]
|
|
526 Onerr goto [+label]
|
|
527
|
|
528 Same as GOTO except that it does not execute until a command errors. After the
|
|
529 error, the GOTO command specified is performed. Note that while executing a
|
|
530 GOTO, the error variable ('%*') is not updated, allowing for error
|
|
531 identification at the goto label.
|
|
532
|
|
533 Entering ONERR alone on a line causes the on error trap to be cancelled.
|
|
534
|
|
535 As with the goto command, '*\' causes the goto to be cancelled.
|
|
536
|
|
537 Example:
|
|
538
|
|
539 onerr goto lab1
|
|
540 dir sd <---- errors with #216
|
|
541 pmap <---- not executed
|
|
542 mmap <---- not executed
|
|
543 *lab1 <---- label matched
|
|
544 if %*=216 <----- expands to 'if 216=216' which evaluates true
|
|
545 goto lab2 <----- jumps to label lab2
|
|
546 else <----- ignored because condition was true
|
|
547 echo ERROR <----- " "
|
|
548 endif <----- tells shell o.k. to process lines again
|
|
549 smap <----- ignored cause we're going to lab2
|
|
550 *lab2 <----- found
|
|
551 ..... <----- processing continues here
|
|
552
|
|
553
|
|
554
|
|
555
|
|
556 PATH=
|
|
557 -----
|
|
558
|
|
559 Path= allows you to specify alternate directorys to search for commands. If the
|
|
560 current execution directory does not contain the desired module, the alternate
|
|
561 paths will be searched in the order specified. This is especially useful for
|
|
562 floppy disk users with limited space, as it allows you to have your CMDS
|
|
563 directory spread across 2 or more disks. The specified paths are retained when
|
|
564 subshells are forked, either by directly calling the shell (shell i=/w&) or by
|
|
565 running a shellscript/memscript.
|
|
566
|
|
567
|
|
568 88/10/12 19:42 Shell+ V2.1 Page 010
|
|
569
|
|
570
|
|
571 Pathlists must be separated by spaces only. To clear alternate paths, type
|
|
572 'path=' with no parameters.
|
|
573
|
|
574 To display the currently assigned paths, use 'path=?' .
|
|
575
|
|
576 Example:
|
|
577
|
|
578 path=/d1/cmds /d2/cmds /d2/newcmds
|
|
579
|
|
580 path=? <** produces
|
|
581 /d1/cmds
|
|
582 /d2/cmds
|
|
583 /d2/newcmds
|
|
584
|
|
585
|
|
586 SECURITY
|
|
587 --------
|
|
588
|
|
589 If the userid is not 0, any '@' characters will be stripped out to prevent
|
|
590 os9 security being overriden by being able to dump a disk. The potential
|
|
591 problem with prompt setting (@=device name) is taken care of by allowing an
|
|
592 [alt]@ to be accepted in addition to '@'.
|
|
593
|
|
594 If this feature is undesirable, it can be removed by
|
|
595 'modpatch <atcheck.off.scr' and then saving the shell. It can be turned on
|
|
596 again by 'modpatch <atcheck.on.scr' and saving.
|
|
597
|
|
598
|
|
599 SHELL SUBS
|
|
600 ----------
|
|
601
|
|
602 A new type of module is supported by this release of Shell+ - the ShellSub
|
|
603 module. These modules are asm subroutines which pass data back to the shell
|
|
604 in the 10 reserved shell sub variables (%%0 - %%9). For instance, the Sdate
|
|
605 shellsub (included in this archive) returns the current month name and
|
|
606 year,month,day,hours,minues,seconds all in separate variables. These variables
|
|
607 can then be examined and acted upon by the shell (possibly for displaying or
|
|
608 IF/THEN/ELSE testing). Note again that the shell sub variables can NOT be
|
|
609 modified by the user, only by shell subroutines. They can, however, be loaded
|
|
610 into the regular user variable set for manipulation.
|
|
611
|
|
612 Technical notes :
|
|
613 When the shell determines that a ShellSub is to be run (by a $51 in the
|
|
614 Type/Language byte in the module header) it loads the registers in a
|
|
615 manner similar to those used when forking a module :
|
|
616
|
|
617 X - parameter area start
|
|
618 D - parameter area size
|
|
619 Y - subroutine entry point
|
|
620 U - first ShellSub buffer
|
|
621
|
|
622 It is the responsibility of the shellsub to ensure that each variable
|
|
623 ends with a <cr> and start at the correct locations (10 variables of 81
|
|
624 bytes each). The shellsub must also end with an rts to return control
|
|
625 back to the shell. The shellsub is therefore also responsible for
|
|
626 ensuring that the stack points to the same place at exit as it did upon
|
|
627 entrance. The shell has about 750 bytes available for stack use. All
|
|
628 registers used by the shell are saved before calling the shellsub &
|
|
629 restored after the shellsub returns.
|
|
630
|
|
631 88/10/12 19:42 Shell+ V2.1 Page 011
|
|
632
|
|
633
|
|
634 USER STARTUP FILE EXECUTION
|
|
635 ---------------------------
|
|
636
|
|
637 The reserved word 'S.T.A.R.T.U.P' will cause the shell to attempt running a
|
|
638 file called 'startup' in the CURRENT directory. This is very useful when
|
|
639 running Tsmon/Login and you are changing the users working directory. If the
|
|
640 users directory is changed and then the program forked is 'shell s.t.a.r.t.u.p'
|
|
641 the shell will try to run a startup file in the new directory and then remain
|
|
642 active. If no startup file is present, no error is returned.
|
|
643
|
|
644
|
|
645 MISC
|
|
646 ----
|
|
647
|
|
648 A command called PROMPT is included in this archive. It functions the same as
|
|
649 the ECHO command except that it does not do a linefeed after displaying the
|
|
650 line. See the example script under SHELL VARIABLES.
|
|
651
|
|
652 Also included in the archive is a shellscript called SHELLSCRIPT. This is what
|
|
653 I use to assemble the various versions of Shell+. It is included as an example
|
|
654 of variables,goto and if/then/else use. It is NOT needed to install or use
|
|
655 Shell+.
|
|
656
|
|
657 You may modify the priority of commands using the "^" (up carat) symbol.
|
|
658 Example: list file >/p ^100 &
|
|
659
|
|
660 Since all the coding for PWD/PXD is part of the shell for the $ option on
|
|
661 prompt setting, the commands .PWD and .PXD are included with the shell. Once
|
|
662 you do a .PWD or .PXD the directory will be kept in a buffer so that next time
|
|
663 you execute the command it won't have to check the disk. It will also stay in
|
|
664 the buffer if the $ option is used in the prompt. Note that if a pathlist is
|
|
665 over 129 chars long, it will be printed prefixed with an '*', indicating that
|
|
666 the beginning of the pathlist has not been printed. This also applies when
|
|
667 using the working directory as part of the shell prompt. Note : Even if you
|
|
668 use the .PWD/.PXD functions you should keep those commands in your execution
|
|
669 directory, as other programs (notably basic09 routines) may use the shell to
|
|
670 get the current directorys. It is for this reason that the commands are
|
|
671 prefixed with a '.' .
|
|
672
|
|
673 CD and CX are also allowed for CHD and CHX for Nuxi people. Also '|' allowed
|
|
674 along with '!' as pipe character.
|
|
675
|
|
676 Echoed input lines ('T' option) will now display the full input line. Why
|
|
677 print only 80 chars if the input buffer is 200 ?
|
|
678
|
|
679 All modules are now forked with a minimum of 7936 bytes (8k - 1 page) to
|
|
680 handle the greatly expanded parameter line size. If the module needs > 8k or
|
|
681 a memory modifier > 8k (#16k) is specified, that size will be used.
|
|
682
|
|
683
|
|
684 If you find any bugs, please let Ron Lammardo (75706,336) know through the CIS
|
|
685 OS9 forum, so that we can take care of them. Suggestions, bitches and kudos
|
|
686 appreciated also.
|
|
687
|
|
688
|
|
689
|
|
690
|
|
691
|
|
692
|
|
693
|
|
694 88/10/12 19:42 Shell+ V2.1 Page 012
|
|
695
|
|
696
|
|
697 Some of the enhancements in Shell+ came either directly from or were derived
|
|
698 from existing utilities. The ones I can remember are :
|
|
699
|
|
700 Goto - Kevin Darling
|
|
701 Z= - from GPERE by Kent Meyers
|
|
702 Wildcards - Simmule Turner
|
|
703 NOBLOCK - Kent Meyers
|
|
704 Logging - Karl Krieder
|
|
705
|
|
706 Shell+ Release 1.0 by Kent Meyers
|
|
707 Shell+ Release 1.1 by Kent Meyers,Kevin Darling,Ron Lammardo
|
|
708
|
|
709
|
|
710 V2.0 additions/changes
|
|
711 -----------------------
|
|
712
|
|
713 - Current date/time displayed when shell starts
|
|
714
|
|
715 - Current date / time can be used as all or part of the shell prompt.
|
|
716
|
|
717 - Standard error redirection return fixed for pipes / EX bug fixed
|
|
718
|
|
719 - Memory scripts
|
|
720
|
|
721 - Shell Variables (VAR.# , %# , %*, VAR.? , V , -V ) / INC. / DEC.
|
|
722
|
|
723 - PATH= command (PATH=?) / PAUSE command
|
|
724
|
|
725 - IF / THEN / ELSE / ENDIF / FI / CLRIF
|
|
726
|
|
727 - GOTO / ONERR GOTO / *\
|
|
728
|
|
729 - Wildcarding
|
|
730
|
|
731 - Path redirection (Z= , R=)
|
|
732
|
|
733 - @ removal for users other than user 0 / Logging (L / -L)
|
|
734
|
|
735 - Shell Subs (%%#)
|
|
736
|
|
737 - User Startup execution
|
|
738
|
|
739
|
|
740 V2.1 additions/changes
|
|
741 -----------------------
|
|
742
|
|
743 - Wildcard Quoting ('\' as escape character)
|
|
744
|
|
745 - Wildcarding rewritten (fix comment line errors,upper/lower match,range)
|
|
746
|
|
747 - Packed BASIC09 memory size error fixed
|
|
748
|
|
749 - Large parameter line into shell fixed
|
|
750
|
|
751
|