Updated doc and stuff

This commit is contained in:
Patrick Kloepfer 2019-12-16 16:33:24 -05:00
parent cf5348bf1e
commit 75bc1fa2ef
13 changed files with 466 additions and 516 deletions

View File

@ -1,6 +1,6 @@
# A2osX Command Guide
### Updated December 3, 2019
### Updated December 15, 2019
This Guide provides information on all the A2osX commands and utilities. This Guide helps you not only learn the purpose of each command but also what options a command supports and what arguments it either supports or requires.
@ -14,19 +14,15 @@ Typically, you will not directly use the System group commands; they are more co
### CIFSD
| Command |
| --- |
| CIFSD \< ip \| host \> sharename mountpoint |
cifsd ip|host sharename mountpoint
CIFSD is a utility for mounting CIFS shares as volumes on A2osX. This utility is in development and is targeted for a future release of A2osX.
**cifsd** is a utility for mounting CIFS shares as volumes on A2osX. This utility is in development and is targeted for a future release of A2osX.
### GETTY
| Command | Options |
| --- | --- |
| GETTY | -E : Exit upon disconnect |
getty [-e] device process
GETTY, short for "get tty", is a system process for A2osX that manages physical or virtual terminals (TTYs). When it detects a connection, it prompts for a user name and then loads the system process LOGIN to authenticate the user. Each GETTY process creates a pseudo file such as /DEV/TTY1 or /DEV/TTY2 to allow A2osX pass input/output streams between processes and connected users.
**getty**, short for "get tty", is a system process for A2osX that manages physical or virtual terminals (TTYs). When it detects a connection, it prompts for a user name and then loads the system process LOGIN to authenticate the user. Each GETTY process creates a pseudo file such as /DEV/TTY1 or /DEV/TTY2 to allow A2osX pass input/output streams between processes and connected users. If **getty** is called with the **-e** option, it will automatically exit when the user ends their session or disconnects (used by TELNETD).
GETTY handles 3 types of connections:
* *virtual terminals* presented and controlled by your Apple Screen and Keyboard. One GETTY process serves one virtual terminal. You can configure the number of virtual terminals on your A2osX system using the KCONFIG utility. Please see **[KCONFIG](#kconfig)**.
@ -35,37 +31,29 @@ GETTY handles 3 types of connections:
### HTTPD
| Command |
| ---- |
| HTTPD |
httpd
This is a stub, or a placeholder, for a new service being added to A2osX. It will provide simple web services. Full implementation is targeted for 0.94.
HTTPD is a server process that listens for incoming requests to server web pages from your A2osX system. It listens for these requests on port 80. This server process is in development and is in fact being used for test purposes only right now. Further document and options will be made available in a future A2osX release. Network services must be started to use this command.
### INITD
| Command |
| ---- |
| INITD RunLevel |
initd runlevel
This is a stub, or a placeholder, for a new routine being added to A2osX. It will replace part of the start up process and allow for different run levels to be initiated included RunLevel 0 or shutdown. Full implementation is targeted for 0.94.
### INSDRV
| Command |
| ---- |
| INSDRV Driver |
insdrv driver
INSDRV, short for "install driver", is a system process that loads and initializes hardware drivers for A2osX. Drivers are available for the Apple Mouse, Super Serial Card, and a range of Ethernet cards. Please see the Hardware section of the User Guide for more complete information on the drivers available for A2osX and enabling them in your system.
**insdrv**, short for "install driver", is a system process that loads and initializes hardware drivers for A2osX. Drivers are available for the Apple Mouse, Super Serial Card, and a range of Ethernet cards. Please see the Hardware section of the User Guide for more complete information on the drivers available for A2osX and enabling them in your system.
### KCONFIG
| Command |
| ---- |
| KCONFIG |
kconfig
![](../.screen-shots/ScreenShot.KCONFIG.png)
KCONFIG, short for "Kernel Configuration" Utility, is a system program that allows the A2osX administrator to configure various settings of their A2osX system. Any changes to your system configuration are stored in A2OSX.KCONFIG located in the root directory of your A2osX installation. When A2osX boots and loads the KERNEL process, it looks for this file, and if not present it initializes the KERNEL with A2osX defaults.
**kconfig**, short for "Kernel Configuration" Utility, is a system program that allows the A2osX administrator to configure various settings of their A2osX system. Any changes to your system configuration are stored in A2OSX.KCONFIG located in the root directory of your A2osX installation. When A2osX boots and loads the KERNEL process, it looks for this file, and if not present it initializes the KERNEL with A2osX defaults.
In KCONFIG you can set:
- Machine Timing, either 60 (Default) or 50Hz. This should match the power/timing of your system. A2osX uses the Apple's VBL signal and this setting to correctly produce 1-Second and 1/10th-Second events which are used to preemptively switch tasks. If this setting does not match your actual machine timing, timing of task switches will be slower/faster by 10-20% but otherwise A2osX should operate normally.
@ -76,53 +64,43 @@ In KCONFIG you can set:
### LOGIN
| Command |
| ---- |
| LOGIN |
login
LOGIN is a system process for A2osX that authenticates users against the A2osX User Database stored in ./ETC/PASSWD. Once a user is authenticated, LOGIN then loads the SH (./BIN/SH) process passing it the PROFILE script found in the users Home directory.
**login** is a system process for A2osX that authenticates users against the A2osX User Database stored in ./ETC/PASSWD. Once a user is authenticated, **login** then loads the **sh** (./BIN/SH) process passing it the PROFILE script found in the users Home directory.
>Note, at the shell prompt you can execute the **LOGIN** command which will then ask you for a name/password and create a new user "session" for you as if you are that user. You will have a new shell environment and be placed in that user's home directory. When you type **EXIT** or press Control-D at the shell prompt, that session will be terminated and you will returned to your original session in tact.
>Note, at the shell prompt you can execute the **login** command which will then ask you for a name/password and create a new user "session" for you as if you are that user. You will have a new shell environment and be placed in that user's home directory. When you type **exit** or press Control-D at the shell prompt, that session will be terminated and you will returned to your original session in tact.
### NETWORKD
| Command |
| ---- |
| NETWORKD networklibrary [networklibrary] ... |
networkd netlibrary [netlibrary] ...
This system command loads one or more libraries providing network services to A2osX applications and utilities such as Telnet, TelnetD and HTTPD. Note, the appropriate Ethernet card driver must first be loaded before attempted to load network libraries. In most cases, network services will be started with a script or as part of the boot process that will load the appropriate drivers, libraries and service programs in the right order. Consult the User Guide for more information on A2osX networking.
This system command loads one or more libraries providing network services to A2osX applications and utilities such as **telnet**, **telnetd** and **httpd**. Note, the appropriate Ethernet card driver must first be loaded before attempted to load network libraries. In most cases, network services will be started with a script or as part of the boot process that will load the appropriate drivers, libraries and service programs in the right order. Consult the User Guide for more information on A2osX networking.
### TELNETD
| Command | Options |
| ----- | --- |
| TELNETD | [port] : Specify optional port |
telnetd [port]
TELNETD is a server process that listens for incoming requests to connect to your A2osX system. By default it listens on Port 23. You can change the Telnet Server port by starting the TELNETD process and specifying an alternate port. Typically this would be used to get around local firewall or port restrictions such as when you are running your server at home on a DSL or Cable connection and your provider blocks port 23. In addition, if you are running in an environment with only one public IP address and you have another system at that site already running a Telnet server, you can use this option to move your A2osX host to alternate port.
**telnetd** is a server process that listens for incoming requests to connect to your A2osX system. By default it listens on Port 23. You can change the Telnet Server port by starting the **telnetd** process and specifying an alternate port. Typically this would be used to get around local firewall or port restrictions such as when you are running your server at home on a DSL or Cable connection and your provider blocks port 23. In addition, if you are running in an environment with only one public IP address and you have another system at that site already running a Telnet server, you can use this option to move your A2osX host to alternate port.
When TELNETD detects an incoming request it starts a GETTY process and creates a virtual internet terminal for the user and begins the LOGIN process same as the system would for a hardwired terminal. Note TELNETD requires that you have a supported Ethernet card and have configured your system for a network appropriately.
When **telnetd** detects an incoming request it starts a **getty** process and creates a virtual internet terminal for the user and begins the **login** process same as the system would for a hardwired terminal. Note **telnetd** requires that you have a supported Ethernet card and have configured your system for a network appropriately.
## BIN/External Shell commands:
The BIN or "External" shell commands are the tools used by most users to display and manipulate data stored on their A2osX system. Typical commands allow you to display directory contents (LS), display file contents (CAT), copy files (CP), delete files (RM), etc. These commands are found in **./BIN/** letting you know they are normal user commands.
The BIN or "External" shell commands are the tools used by most users to display and manipulate data stored on their A2osX system. Typical commands allow you to display directory contents (**ls**), display file contents (**cat**), copy files (**cp**), delete files (**rm**), etc. These commands are found in **./bin/** letting you know they are normal user commands.
### BMP2PIX
| Command | Options |
| ----- | --- |
| BMP2PIX BMP-File | -V : Verbose Mode |
bmp2pix [-v] bmpfile
BMP2PIX is a graphics conversion utility that will make PIX format files from standard PC format BMP graphics files. The PIX format is used by A2osX to display logos and icons.
**bmp2pix** is a graphics conversion utility that will make PIX format files from standard PC format BMP graphics files. The PIX format is used by A2osX to display logos and icons. If you specify the **-v** option, **bmp2pix** will output verbose conversion information.
### CAT
| Command | Options |
| --- | --- |
| CAT filename | -A : Show All non printable characters <br> -N : Number all output lines <br> -S : Suppress repeated empty output lines |
cat [-a] [-n] [-s] file
The CAT command is used to display the contents of files stored on any ProDOS volume. While the primary use of this tool is to display the contents of TEXT or TXT files, it can be used to display the contents of other files by using the -A option, which will substitute non-printable characters with readable and displayable values such as [EOF] for End of File (Hex x04) or [LF] for Line Feed (Hex x0A). In addition you can use the -N option to display the listing of a file with line numbers.
The **cat** command is used to display the contents of files stored on any ProDOS volume. While the primary use of this tool is to display the contents of TEXT or TXT files, it can be used to display the contents of other files by using the **-a** option, which will substitute non-printable characters with readable and displayable values such as [EOF] for End of File (Hex x04) or [LF] for Line Feed (Hex x0A). In addition you can use the **-n** option to display the listing of a file with line numbers. Lastly the **-s** option can be used to suppress multiple blank lines from being displayed.
As an example, if you had a text file called CATTEXT with the following lines:
As an example, if you had a text file called cattext with the following lines:
Start of Cattext
@ -131,7 +109,7 @@ As an example, if you had a text file called CATTEXT with the following lines:
Then if you executed at the A2osX prompt:
/A2OSX/ROOT/$ CAT -N CATTEXT
/A2OSX/ROOT/$ cat -n cattext
You would get:
@ -142,7 +120,7 @@ You would get:
> 4: End of Cattext
----------
If you did CAT -N -S CATTEXT to suppress the extra blank lines you would see:
If you did **cat -n -s cattext** to suppress the extra blank lines you would see:
----------
> 1: Start of Cattext
@ -150,113 +128,98 @@ If you did CAT -N -S CATTEXT to suppress the extra blank lines you would see:
> 4: End of Cattext
----------
Note that the numbering of the lines didn't change, because that is their true number in f the file, but CAT removed the redundant blank lines. Whether there are 2 or 200 blank lines in a row, they will be reduced to just 1.
Note that the numbering of the lines didn't change, because that is their true number in f the file, but **cat** removed the redundant blank lines. Whether there are 2 or 200 blank lines in a row, they will be reduced to just 1.
### CHGRP
| Command |
| --- |
| CHGRP |
chgrp [-c] [-r] group filespec
This command is not currently implemented.
### CHMOD
| Command |
| --- |
| CHMOD |
chmod [-c] [-r] mode filespec
This command is not currently implemented.
This command is not currently *fully* implemented.
### CHOWN
| Command | Options |
| --- | --- |
| CHOWN | -C : Continue On Error <br> -R : Recurse subdirectories |
chown [-c] [-r] owner filespec
This command is not currently implemented.
### CHTYP
| Command | Options |
| --- | --- |
| CHTYP File Type| -C : Continue On Error <br> -R : Recurse subdirectories |
chtyp [-c] [-r] type filespec
This utility allows you to change the type of a file to a standard files types such as SYS or TXT or to any 2-byte hex code.
### CMP
CMP [-V [-A]] File1 File2 [Skip1 [Skip2]]
cmp [-v [-a]] file1 file2 [skip1 [skip2]]
| Command | Options |
| --- | --- |
| CMP File1 File2 [SKIP1 [SKIP2]]| -A : Shows All differences <br> -V : Verbose Mode |
CMP will compare two files to determine if they are byte for byte equal. If the files are equal CMP exits normally with an exit code of 0. If the files have one or more bytes that are different, CMP will exit with an application error code of 224 (Hex $E0). By using the Verbose option you can see the offset and values of the first different byte. With the Verbose and All options you can see the list of all offsets and values that are different. The SKIP options allow you specify a number of bytes to skip in the file(s) before starting the comparison. CMP A B 100 200 would skip to the 100th byte of A and the 200th byte of B before starting the byte by byte comparison. Note then that B would need to be 100 bytes larger then A for the comparison to ever end without error.
**cmp** will compare two files to determine if they are byte for byte equal. If the files are equal **cmp** exits normally with an exit code of 0. If the files have one or more bytes that are different, **cmp** will exit with an application error code of 224 (Hex $E0). By using the Verbose option you can see the offset and values of the first different byte. With the Verbose and All options you can see the list of all offsets and values that are different. The SKIP options allow you specify a number of bytes to skip in the file(s) before starting the comparison. **cmp** A B 100 200 would skip to the 100th byte of A and the 200th byte of B before starting the byte by byte comparison. Note then that B would need to be 100 bytes larger then A for the comparison to ever end without error.
### CP
CP [-C] [-Q] [-R] SourceFileSpec [DestinationFileSpec]
cp [-c] [-q] [-r] [-y] sourcefilespec [destinationfilespec]
| Command | Options |
| --- | --- |
| CP | -C : Continue On Error <br> -Q : Quiet <br> -R : Recurse subdirectories <br> -Y : Dont't Prompt For Override | 0.93 |
CP, which stands for Copy, is one of the most powerful commands in A2osX. Not only can it copy files from one ProDOS volume to another, it can copy entire directories or even directory trees from volume to volume, or to another location on the same volume. This recursive nature allows you to use a single command to copy the contents of an entire ProDOS volume with a single command. CP also supports wild cards so that you can copy just those files matching a pattern.
The copy command, **cp**, is one of the most powerful commands in A2osX. Not only can it copy files from one ProDOS volume to another, it can copy entire directories or even directory trees from volume to volume, or to another location on the same volume. This recursive nature allows you to use a single command to copy the contents of an entire ProDOS volume with a single command. The **cp** command also supports wild cards so that you can copy just those files matching a pattern.
Normally CP displays each file name being copied. With the Quiet option (-Q), this output is suppressed. The Quiet option may be helpful in scripts where maintaining control of the display is important.
Normally **cp** displays each file name being copied. With the Quiet option (**-q**), this output is suppressed. The Quiet option may be helpful in scripts where maintaining control of the display is important. Normally, when **cp** copies file, it checks to see if a file already exists in the destination, and if so, it prompts the user to ensure they want to overwrite the existing file. With the No Prompt option (**-y**), **cp** will automatically overwrite any existing files. With the Continue option (**-c**), **cp** will continue processing other files in a filespec (i.e. * or file???x) when it encounters an error such as a locked file.
### CSH
| Command |
| --- |
| CSH Script |
csh cscript
CSH is one of the interactive and script processing shells under development for A2osX. The CSH is similar to the C Shell in Linux and uses the C syntax structure for scripting. This shell is under development. A CSH Shell Developers Guide will be available when a release candidate for this shell becomes available.
**csh** is one of the interactive and script processing shells under development for A2osX. The **csh** is similar to the C Shell in Linux and uses the C syntax structure for scripting. This shell is under development. A **csh** Shell Developers Guide will be available when a release candidate for this shell becomes available.
### CUT
| Command | Options |
| --- | --- |
| CUT \<opt\> "line" or <br> CMD \| CUT \<opt\> | -F nn : Output field nn <br> -M nn : Output starting at nn <br> -N nn : Output Ending at nn <br> -S ch : Change default SPACE separator to 'ch' |
cut [ [[-f field] [-s char]] | [-m column] [-n column] ] <string>
cmd | cut [ [[-f field] [-s char]] | [-m column] [-n column] ]
The CUT command is used to extract a sub-part or portion of a string. Use this command to simply extract sub-strings much like Basic's MID, LEFT, or RIGHT might be used. It can also be used within the powerful FOR NEXT construct to process fields of columns from files or the output of processes.
The **cut** command is used to extract a sub-part or portion of a string. Use this command to simply extract sub-strings much like Basic's MID, LEFT, or RIGHT might be used. It can also be used within the powerful FOR NEXT construct to process fields of columns from files or the output of processes. If you execute **cut** with no options it will simply pass through all input to the output. To be useful you must use either the field (**-f**) or column (**-m and -n**) switches. With the field switch, you tell **cut** which separated column of text to return. By default fields are separated by spaces, but you can change this to another character with the separator switch (**-s**). The other option is to use the column switches to denote the start (**-m**) and stop (**-n**) column to return.
As an example, normally when you execute the **LS -L /** command you get output similar to:
As an example, normally when you execute the **ls -l /** command you get output similar to:
/A2OSX.BUILD/ROOT/$ LS -L /
/RAM3 S3D2 Blocks Used:8 Total:16000
/A2OSX.BUILD S7D1 Blocks Used: 3230 Total:65535
/MAKE S7D2 Blocks Used:48946 Total:65535
----------
> /A2OSX.BUILD/ROOT/$ LS -L /
> /RAM3 S3D2 Blocks Used:8 Total:16000
> /A2OSX.BUILD S7D1 Blocks Used: 3230 Total:65535
> /MAKE S7D2 Blocks Used:48946 Total:65535
----------
Now, if instead we execute the follow command at the shell prompt:
/A2OSX.BUILD/ROOT/$ FOR F IN `LS -L /`;ECHO $F;NEXT
/RAM3 S3D2 Blocks Used:8 Total:16000
/A2OSX.BUILD S7D1 Blocks Used: 3230 Total:65535
/MAKE S7D2 Blocks Used:48946 Total:65535
----------
> /A2OSX.BUILD/ROOT/$ FOR F IN `LS -L /`;ECHO $F;NEXT
> /RAM3 S3D2 Blocks Used:8 Total:16000
> /A2OSX.BUILD S7D1 Blocks Used: 3230 Total:65535
> /MAKE S7D2 Blocks Used:48946 Total:65535
----------
It looks like the same results, but from now instead of LS simply outputting all of its results at once, each line is being passed to the FOR loop (as VAR $F) where we simply ECHO it. Now imagine if instead we passed $F to CUT, we can display only specific columns of information as seen in these two examples:
It looks like the same results, but instead of LS simply outputting all of its results at once, each line is being passed to the FOR loop (as VAR $F) where we simply ECHO it. Now imagine if instead we passed $F to CUT, we can display only specific columns of information as seen in these two examples:
/A2OSX.BUILD/ROOT/$ FOR F IN `LS -L /`;CUT -M 00 -N 15 $F;NEXT
/RAM3
/A2OSX.BUILD
/MAKE
/A2OSX.BUILD/ROOT/$ FOR F IN `LS -L /`;CUT -M 17 -N 21 $F;NEXT
S3D2
S7D1
S7D2
----------
> /A2OSX.BUILD/ROOT/$ FOR F IN `LS -L /`;CUT -M 00 -N 15 $F;NEXT
> /RAM3
> /A2OSX.BUILD
> /MAKE
>
> /A2OSX.BUILD/ROOT/$ FOR F IN `LS -L /`;CUT -M 17 -N 21 $F;NEXT
> S3D2
> S7D1
> S7D2
----------
### EDIT
| Command |
| --- |
| EDIT [filename] |
edit file
The EDIT command allows the user to interactively read and edit standard text files in A2osX. If you do not specify a file name on the command line, you will be prompted to enter one when you save your work (control-S). Consult the help screen below for a list of the special keys that can be used while editing a file.
The **edit** command allows the user to interactively read and edit standard text files in A2osX. If you do not specify a file name on the command line, you will be prompted to enter one when you save your work (control-S). Consult the help screen below for a list of the special keys that can be used while editing a file.
>A note for the touch typists!: While EDIT is not a word processor, it still is one of the most complex programs included in A2osX. It does a lot! A side affect of this, and due to the lack of a keyboard buffer in the Apple //e, if you try to speed type while using EDIT some keystrokes may be dropped. This is most noticeable when using the AppleWin emulator set to 1.0 speed. Changing the emulator speed to at least 2.0 will significantly reduce or eliminate the dropped keys.
>A note for the touch typists!: While **edit** is not a word processor, it still is one of the most complex programs included in A2osX. It does a lot! A side affect of this, and due to the lack of a keyboard buffer in the Apple //e, if you try to speed type while using EDIT some keystrokes may be dropped. This is most noticeable when using the AppleWin emulator set to 1.0 speed. Changing the emulator speed to at least 2.0 will significantly reduce or eliminate the dropped keys.
![](../.screen-shots/ScreenShot.EDIT.png)
@ -269,16 +232,17 @@ There is a help screen
| Command | Options |
| --- | --- |
| FORMAT \<BLOCKDEV\> [VOLUME.NAME] | -B Blocks : Force number of blocks to format <br> -L : Low-Level Format *not currently supported <br> -1..9 : Catalog Size (block count) |
format -b blocks [-L] [-1|-2|-3|-4|-5|-6|-7|-8|-9]
The FORMAT command will erase an existing volume and update its name to the VOLUME.NAME supplied. FORMAT does not currently support low level formatting. The Volume/Device to be formatted must already be formatted. Specifically this means that FORMAT cannot format a new (never been formatted) floppy disc. Use the -B option to force a block count to format. This is useful in AppleWin because of its non-standard implementation of SmartPort on Slot 7.
The **format** command will erase an existing volume and update its name to the VOLUME.NAME supplied. **format** does not currently support low level formatting. The Volume/Device to be formatted must already be formatted. Specifically this means that **format** cannot format a new (never been formatted) floppy disc. Use the -B option to force a block count to format. This is useful in AppleWin because of its non-standard implementation of SmartPort on Slot 7.
### GREP
| Command | Options |
| --- | --- |
| GREP \<opt\> PATTERN FILE <br> CMD \| GREP \<opt\> PATTERN | -I : Ignore Case <br> -N : Print line Number | 0.93 |
grep [-i] [-n] pattern file
command | grep [-i] [-n] pattern
The GREP command parses multiple lines of input (either from a file or from the redirected output of another command) and only outputs those lines that contain the PATTERN. In this way, you can think of the GREP command as a filter. You can use the -I option to force GREP to ignore case in the PATTERN and the INPUT lines (i.e. it capitalizes both the source and the PATTERN before doing the compare) though it still outputs the actual lines of content that match (their original capitalization is preserved).
The GREP command parses multiple lines of input (either from a file or from the redirected output of another command) and only outputs those lines that contain the PATTERN. In this way, you can think of the GREP command as a filter. You can use the -I option to force GREP to ignore case in the PATTERN and the INPUT lines (i.e. it capitalizes both the source and the PATTERN before doing the compare) though it still outputs the actual lines of content that match (their original capitalization is preserved). The Print Line switch (**-n**) will print number for the lines that match the pattern.
Example
@ -290,27 +254,22 @@ In this example, only those volumes that are attached to Slot 7 are listed.
### KILL
| Command | Options |
| --- | --- |
| KILL \<signal\> PID | -0 : No Signal <br> -1 : SIGQUIT <br> -2 : SIGKILL | 0.93 |
kill [-0|-1|-2] pid
The KILL command kills or terminates a running process. This can be most useful when you have a running process that is stuck (perhaps you are debugging a program or script). Switch to another virtual terminal (by pressing Open Apple-1) and executing the PS command to list currently running processes. Then execute the KILL command on the errand process by its PID found in the displayed process list (i.e. KILL 27 to terminate process with a PIP of 27). Consult the A2osX User Guide for information on using and switching between virtual terminal sessions on your Apple.
The KILL command kills or terminates a running process. This can be most useful when you have a running process that is stuck (perhaps you are debugging a program or script). Switch to another virtual terminal (by pressing Open Apple-1) and executing the PS command to list currently running processes. Then execute the KILL command on +
the errand process by its PID found in the displayed process list (i.e. KILL 27 to terminate process with a PIP of 27). Consult the A2osX User Guide for information on using and switching between virtual terminal sessions on your Apple. The optional switches change the type of kill signal sent to the process being killed (-0 for No Signal, -1 for SIGQUIT and -2 for SIGKILL).
### LS
| Command | Options |
| --- | --- |
| LS [filespec] | -A : Print . & .. <br> -C : Single column listing <br> -F : Single column, includes full path <br> -L : long listing with size/date... <br> -R : Recurse subdirectories |
ls [-a] [-c|-f|-l] [-r] filespec
The LS command is probably the most used and useful of all commands available to the A2osX user. LS allows you to list the names of the files (with or without extended file info such as modification date and size with the -L option) in a directory or even an entire tree using the Recurse (-R) option. You can pass the LS command a filespec that includes a directory name and or wildcard spec for filtering the listing. For example the command `LS ../MYDIR/FT*` would only list files that begin with FT and are found in the MYDIR sub directory of the parent of the current directory.
The LS command is probably the most used and useful of all commands available to the A2osX user. LS allows you to list the names of the files and directories in the current or specified directory. If supplied with the all check (**-a**) **ls** will include the special directories **.** and **..**. The recurse check (**-r**) tells **ls** to list files and directories of any directory listed (recursively). The display checks (**-c -f and -l**) tell **ls** change the format of the display to a single column of just file/directory names (**-c**), to a single column that includes full paths (**-f**) or a listing with extended file information (**-l**) which includes file ownership, permissions, date/time, etc.. You can pass the **ls** command a *filespec* that includes a directory name and or wild card spec for filtering the listing. For example the command `LS ../MYDIR/FT*` would only list files that begin with FT and are found in the MYDIR sub directory of the parent of the current directory.
![](../.screen-shots/ScreenShot.LS.png)
### LSDEV
| Command |
| --- |
| LSDEV |
lsdev
Displays a listing of the currently defined devices in the running A2osX system as seen in the screenshot below.
@ -318,61 +277,48 @@ Displays a listing of the currently defined devices in the running A2osX system
### LSOF
| Command |
| --- |
| LSOF |
lsof
Displays a listing of the currently open files in a running A2osX system. This utility is particularly useful to run from another virtual terminal (TTY). Consult the A2osX User Guide for information on using and switching between virtual terminal sessions on your Apple.
### MD5
| Command |
| --- |
| MD5 \[ -D : String \| file \]
md5 -d string | file
This utility will generated an MD5 hash on a file or on the text string passed with the -D option.
### MEM
| Command |
| --- |
| MEM |
mem
The MEM command displays the available memory and other stats of the Main, Aux and Kernel memory spaces.
### MKDIR
| Command |
| --- |
| MKDIR filespec |
mkdir dirname
MKDIR will create a new empty directory based on the filespec. If a simple filespec is provided (i.e. mydir or test1) a new directory of that name will be created in the current directory. Optionally, you can pass a fully qualified or relative filespec such as ../../mmdir in which case a new empty directory will be created called **mmdir** and placed in the current directory's parent parent.
### MORE
| Command | Options |
| --- | --- |
| MORE \<File\> or <br> CMD\|MORE \<opt\> | -H : This help screen <br> -N : Number all output lines <br> -P : Page mode, no scroll <br> -S : Process ESC codes
more [-n] [-p] [-s] file
command | more [-n] [-p] [-s]
The MORE utility allows you to scroll through the output of a file or command one screen full or line at a time. You can use MORE on existing text files, or in conjunction with the PIPE facility (\|) you can direct the output of a command or script to MORE to page through that output. This can be very useful for long directory listings `LS -L | MORE`.
The **more** utility allows you to scroll through the output of a file or command one screen full or line at a time. You can use **more** on existing text files, or in conjunction with the PIPE facility (\|) you can direct the output of a command or script to **more** to page through that output. This can be very useful for long directory listings `ls -l | more`. The number switch (**-n**) tells more to number the lines of output. By default, **more** appends its output to the screen a line at a time, which eventually causes the screen to scroll up for each new line. With the page switch (**-p**) **more** will first clear the screen for each page and fill down, eliminating scrolling. By default, **more** strips any TERM (vt100 escape codes) from the output but using the **-s** switch, **more** will send these codes through.
### MV
| Command | Options |
| --- | --- |
| MV [File/Dir, *,? wildcards allowed] [destination]| -C : Continue On Error <br> -Q : Quiet <br> -R : Recurse subdirectories <br> -Y : Dont't Prompt For Override
mv [-c] [-q] [-r] [-y] filespec destination
The MV command moves files (and directories) from one directory of an A2osX file system to another directory on that same or a different file system. MV like the CP command can operate on a single file, a set files using wildcards, a directory or entire directory tree with the Recurse option (-R). Unlike CP, MV does not just copy files to the new destination it removes them from the source once the copy has been completed.
If you are copying an entire directory structure using the Recurse option, MV will not only copy all the files it will create the necessary directories as well and then delete both the source files and directories. Be sure that your destination has sufficient space to hold the files as running out of space mid-copy could result in the directory tree you are attempting to move becoming split between the old and new location.
Normally MV displays each file name being moved. With the Quiet option (-Q), this output is suppressed. The Quiet option may be helpful in scripts where maintaining control of the display is important.
Normally MV displays each file name being moved. With the Quiet option (-Q), this output is suppressed. The Quiet option may be helpful in scripts where maintaining control of the display is important. -y dont prompt for overrides and -c automatically continue on errors such as locked files.
### NSCUTIL
| Command |
| --- |
| NSCUTIL DD/MM/YY,hh:mm:ss |
nscutil [yy/mm/dd,hh:mm:ss]
NSCUTIL is a tool for setting the time of a No Slot Clock or DL1216E.
@ -382,143 +328,113 @@ NSCUTIL is a tool for setting the time of a No Slot Clock or DL1216E.
| --- | --- |
| PAK Archive [File/Dir, *,? wildcards allowed\]| -A: Append to Archive<br> -R: Recurse subdirectories |
PAK is a utility for combining multiple files into a single compact archive. Use the UNPAK utility to separate the files back out. PAK is great for software distribution and installation as it allows the developer to gather up all the files that make up an application into a single distributable archive.
pak [-a] [-r] archive filespec
**pak** is a utility for combining multiple files into a single compact archive. Use the **unpak** utility to separate the files back out. **pak** is great for software distribution and installation as it allows the developer to gather up all the files that make up an application into a single distributable archive.
### PS
| Command |
| --- |
| PS |
The PS command will list the currently running processes on your A2osX system. This is particularly helpful if you need to stop a process that is stuck. See the KILL command.
ps
The **ps** command will list the currently running processes on your A2osX system. This is particularly helpful if you need to stop a process that is stuck. See the **kill** command.
### RM
| Command | Options |
| --- | --- |
| RM \[File/Dir, *,? wildcards allowed\] | -C : Continue On Error <br> -Q : Quiet <br> -R : Recurse subdirectories
The RM command removes or deletes files from an A2osX file system. RM, like the CP command, can operate on a single file, a set files using wildcards, a directory or entire directory tree with the Recurse option (-R).
rm [-c] [-q] [-r] filespec
Normally RM displays each file name being deleted. With the Quiet option (-Q), this output is suppressed. The Quiet option may be helpful in scripts where maintaining control of the display is important.
The **rm** command removes or deletes files from an A2osX file system. **rm**, like the **cp** command, can operate on a single file, a set files using wild cards, a directory or entire directory tree with the Recurse option (**-r**).
Normally **rm** displays each file name being deleted. With the Quiet option (**-q**), this output is suppressed. The Quiet option may be helpful in scripts where maintaining control of the display is important.
### SH
| Command |
| ---- |
| SH Script |
sh
SH is one of the interactive and script processing shells under development for A2osX. The SH shell is similar to the BASH Shell in Linux and uses primarily the BASH syntax structure for scripting. A SH Shell Developers Guide is available in the Documentation Library of A2osX.
**SH** is one of the interactive and script processing shells under development for A2osX. The SH shell is similar to the BASH Shell in Linux and uses primarily the BASH syntax structure for scripting. A SH Shell Developers Guide is available in the Documentation Library of A2osX.
### TERM
term <device>
The **TERM** command is used to start an interactive terminal (VT100) session using an available serial device. You must pass to **term** a valid device name (in lower case) in the form of /dev/comX where X is the slot number of your super serial card. You must have already installed the device driver for this card using the **INSDRV** command and specifying the **SSC.I.DRV**. When you execute the **insdrv ssc.i.drv** command it will search for an available (not used by another process) super serial card and will return to you the name of device installed (i.e. **com2**). Once you start a **TERM** session, you can disconnect from the remote host and return to the shell prompt by pressing Control-T. If you have more then one Apple running A2osX, you could set up one as a host with an SSC that has the right driver installed and a GETTY set for that device (see the User Guide) and then use the other Apple with an SSC to connect to the first one using **TERM**.
### UNPAK
| Command |
| --- |
| UNPAK Archive |
unpak <file>
UNPAK is a utility for extracting files from an A2osxX archive created with the PAK utility (See PAK above).
**UNPAK** is a utility for extracting files from an A2osX archive created with the **PAK** utility (See PAK above).
### USERADD
| Command | Options |
| --- | --- |
| USERADD username | -c Comment : GECOS comment<br> -d HD : Home Directory <br> -p PW : Password <br> -s SH : Shell|
useradd [-c comment] [-d dir] [-p password] [-s shell] username
The USERADD command is used to add a new User ID and Password to the A2osX User Database. Optionally you can all supply a Command, Home Directory and preferred Shell for the User. Please see the User Guide for more information on User Management.
The **useradd** command is used to add a new User ID and Password to the A2osX User Database. Optionally you can all supply a Command, Home Directory and preferred Shell for the User. Please see the User Guide for more information on User Management. The comment switch (**-c**) allows you to specify additional information about the user being added, typically their full name. The directory switch (**-d**) allows you to specify the users home directory. The password switch (**-p**) allows you to specify the users password which will be encrypted. The shell switch (**-s**) allows you to specify the users default shell program, which for now should be **/bin/sh**.
### USERDEL
| Command | Options |
| --- | --- |
| USERDEL username | -r : Force removes files in home directory |
userdel [-r] username
The USERDEL command is used to delete a User ID from the A2osX User Database. Optionally you can have USERDEL remove the users Home directory and any files contained therein. Please see the User Guide for more information on User Management.
The **userdel** command is used to delete a User ID from the A2osX User Database. Optionally you can have **userdel** remove the users Home directory and any files contained therein. Please see the User Guide for more information on User Management.
### WC
| Command | Options |
| ----- | --- |
| WC File(s) (*,? wildcards allowed)| -C: Continue on error<br> -R: Recurse Subdirectories<br> -M: Print CHAR counts<br> -L: Print LINE counts<br> -W: Print WORD counts|
The WC command is used to display the char, line and word counts of one or more files. If more then one file is processed then a total count of all files is also displayed.
wc [-c] [-l] [-m] [-r] [-w] filespec
The **wc** command is used to display the char, line and word counts of one or more files. If more then one file is processed then a total count of all files is also displayed. If you use any of the count switches (**-l -m and/or -w** {line, char and word respectively}) then **wc** will only display the counts for the options specified. For example if you use **-l** then only the line count will be display, while using **-l and -w** will display line and word counts, omitting the char count.
### WHO
| Command |
| ----- |
| WHO |
who
The WHO command displays a list of users currently logged into the A2osX system and which device they are using to connect to the system.
The **who** command displays a list of users currently logged into the A2osX system and which device they are using to connect to the system.
## Network Tools
The Network Tools group of commands allow you to load or start networking services, option IP addresses, connect to other systems, or get the status of your network. Some of these commands are designed specifically as user programs such as Telnet to interactively connect to another computer such as a BBS. Others are intended to be used by system scripts for loading and initializing the network, though they can be run on the command line and therefore are explained here. These commands are found in **./BIN/** letting you know they are user commands.
The Network Tools group of commands allow you to load or start networking services, option IP addresses, connect to other systems, or get the status of your network. Some of these commands are designed specifically as user programs such as Telnet to interactively connect to another computer such as a BBS. Others are intended to be used by system scripts for loading and initializing the network, though they can be run on the command line and therefore are explained here. These commands are found in **./bin/** letting you know they are user commands.
### ARP
| Command |
| ----- |
| ARP [IP [MAC]] |
arp [ip [mac]]
The ARP command can displays the current ARP cache or you can use it to setup a static ARP entry. When adding an entry, IP is a standard IP4 address such as 10.0.0.77 and MAC is a full MAC address in the form 00:00:00:00:00:00 where each 00 can be any hex value from 00 to FF. Network services must be started to use this command.
The **arp** command displays the current ARP cache and can be used to setup a static ARP entry. When adding an entry, *ip* is a standard IP4 address such as *10.0.0.77* and *mac* is a full MAC address in the form 00:00:00:00:00:00 where each 00 can be any hex value from 00 to FF. Network services must be started to use this command.
### DNSINFO
| Command |
| ----- |
| DNSINFO [HOST IP] |
dnsinfo [host ip]
The DNSINFO command can display the current DNS cache or setup a new static DNS entry. When adding an entry, HOST is typically a fully qualified domain name such as **server.acme.com** and IP is a standard IP4 address such as 10.0.0.77. Network services must be started to use this command. If you run this command for a Host with 1 IP Address, you can run the command again for the same host but with a new IP address and the DHS table will be updated appropriately. Note, once you add a host to the DNS table this way, you must reboot your system to clear the entry from memory.
### HTTPD
| Command |
| ----- |
| HTTPD |
HTTPD is a server process that listens for incoming requests to server web pages from your A2osX system. It listens for these requests on port 80. This server process is in development and is in fact being used for test purposes only right now. Further document and options will be made available in a future A2osX release. Network services must be started to use this command.
The **dnsinfo** command can display the current DNS cache or setup a new static DNS entry. When adding an entry, *host* is typically a fully qualified domain name such as *server.acme.com** and *ip* is a standard IP4 address such as *10.0.0.77*. Network services must be started to use this command. If you run this command for a *host* with an *ip* Address, you can run the command again for the same *host* but with a new *ip* address and the DHS table will be updated appropriately. Note, once you add a *host* to the DNS table this way, you must reboot your system to clear the entry from memory.
### HTTPGET
| Command | Options |
| --- | --- |
|HTTPGET <ip\|host> [port]| -U Url <br> -F UrlFile|
httpget ip|host [port] -u url | -f file
The HTTPGET command is a utility for retrieving a network page or message from a specified host/URL. Network services must be started to use this command. You must specify a Url to retrieve either with the -U switch or in a text file specified with the -F switch. Without a Url you will likely get a standard 404 looking web page returned as the result of this command. Typically you would use a command line like the following for httpget:
The **httpget** command is a utility for retrieving a network page or message from a specified host/URL. Network services must be started to use this command. You must specify a Url to retrieve either with the **-u** switch or in a text file specified with the **-f** switch. Without a Url you will likely get a standard 404 looking web page returned as the result of this command. Typically you would use a command line like the following for **httpget**:
HTTPGET www.a2osx.com -U index.html
### IPCONFIG
| Command | Options |
| --- | --- |
|IPCONFIG |-D : Try to get IP address from DHCP <br> -E : Read ETC files <br> -S : Set/Reset TCPIP configuration (-E, then -D if required) |
The IPCONFIG command will display the current network configuration for your system. In some cases, if the network drivers and libraries are loaded but not configured, IPCONFIG may configure your system by obtaining (through DHCP) or setting (statically through config files) your IP address and other settings. Optionally you can force a set/reset of your configuration. If Network services are not started when you use this command, an error message will be displayed saying that TCP/IP is not bound to any device.
ipconfig [-d|-e|-s]
The **ipconfig** command will display the current network configuration for your system. In some cases, if the network drivers and libraries are loaded but not configured, **ipconfig** may configure your system by obtaining (through DHCP) or setting (statically through config files) your IP address and other settings. Optionally you can force a set/reset of your configuration. If Network services are not started when you use this command, an error message will be displayed saying that TCP/IP is not bound to any device.
### NETSTAT
| Command |
| ----- |
| NETSTAT |
netstat
The NETSTAT command displays the current socket status of your A2osX system. Network services must be started to use this command. Netstat will show the Type, Protocol, Local Port, Remote IP and Port as well as the status of any current connection.
The **netstat** command displays the current socket status of your A2osX system. Network services must be started to use this command. **netstat** will show the Type, Protocol, Local Port, Remote IP and Port as well as the status of any current connection.
### PING
| Command |
| ----- |
| PING <ip\|host> <br> -1..9 : Ping Count |
ping [-1|-2|-3|-4|-5|-6|-7|-8|-9] ip|host
The PING command is a utility for testing that the IP network services are working, connected to the network and can reach the specified hosts. PING can be used to both test your A2osX network setup as well as to ensure that the desired end point is online. Network services must be started to use this command.
The **ping** command is a utility for testing that the IP network services are working, connected to the network and can reach the specified hosts. **ping** can be used to both test your A2osX network setup as well as to ensure that the desired end point is online. Network services must be started to use this command. By default, **ping** continues to run until stopped by pressing the break key (Control-C). Alternatively you can tell **ping** to limit the amount of ping attempts by using the single digit numerical switches shown above.
### TELNET
| Command |
| ----- |
| TELNET <ip\|host> [port] |
telnet ip|host [port]
The TELNET command is a complete communications/terminal program for connecting to and interacting with foreign hosts using A2osX IP network services. TELNET can be used to connect to Linux/UNIX systems, Windows hosts or even 8-bit BBS systems as long as they support the standard Telnet protocol. Please note that TELNET does not support SSH or anytime of secure connection model that are the default mode in most newer systems. Network services must be started to use this command.
The **telnet** command is a complete communications/terminal program for connecting to and interacting with foreign hosts using A2osX IP network services. **telnet** can be used to connect to Linux/UNIX systems, Windows hosts or even 8-bit BBS systems as long as they support the standard Telnet protocol. Please note that **telnet** does not support SSH or anytime of secure connection model that are the default mode in most newer systems. Network services must be started to use this command.
## Developer Tools
@ -526,24 +442,20 @@ While almost every command and program that comes with A2osX can be considered a
### ASM
| Command |
| ----- |
| ASM |
asm file
ASM is A2osX's table driven multi-pass macro assembler. This assembler is still in development and will be released shortly. Technical documentation for the assembler and its language can be found in **[ASM](./ASM.md)**. A Guide to using ASM is forthcoming.
**asm** is A2osX's table driven multi-pass macro assembler. This assembler is still in development and will be released shortly. Technical documentation for the assembler and its language can be found in **[ASM](./ASM.md)**. A Guide to using asm is forthcoming.
### MEMDUMP
| Command |
| ----- |
| MEMDUMP |
memdump
![](../.screen-shots/ScreenShot.MEMDUMP.png)
MEMDUMP is a program that allows the developer to display the contents of all of the memory that A2osX is currently using to aide with the debugging of your programs. Lines displayed in inverse indicate memory associated with processes no longer running (dead or abandoned memory, could be caused by program crash).
**memdump** is a program that allows the developer to display the contents of all of the memory that A2osX is currently using to aide with the debugging of your programs. Lines displayed in inverse indicate memory associated with processes no longer running (dead or abandoned memory, could be caused by program crash).
## License
A2osX is licensed under the GNU General Pulic License.
A2osX is licensed under the GNU General Public License.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -1,7 +1,7 @@
# A2osX Shell Developers Guide
### Updated December 8, 2019
### Updated December 15, 2019
One of the most significant parts of A2osX is its shell which can perform both interactive and scripted tasks. Using the interactive part of the shell, you can perform many common and complex tasks using both built-in (native or internal to shell) and external (BIN or executable) commands. Internal commands include CD (change directory), MD (make directory), PWD, DATE, etc. External commands include CP (copy), RM (remove), CAT (display file contents), TELNET, etc. It is even possible to create and execute short scripts right on the interactive command line (these are run once and not saved like true scripts) such as:
@ -13,13 +13,13 @@ This Developers Guide will cover the basic operation of the interactive shell, t
## About the A2osX Shell (SH)
The default A2osX Shell **./BIN/SH** is an external command program like many others included with A2osX. It is probably the most complex and capable, as suggested by its size compared to other commands (7K vs 1K for TELNET). It is the primary tool for interacting with the A2osX system. The SH shell is based loosely on the Linux BASH shell, to the extent possible on an 8-bit machine. Alternative shells are planned for the future and will be announced as they become available.
The default A2osX Shell **./bin/sh** is an external command program like many others included with A2osX. It is probably the most complex and capable, as suggested by its size compared to other commands (7K vs 1K for **telnet**). It is the primary tool for interacting with the A2osX system. The **sh** shell is based loosely on the Linux BASH shell, to the extent possible on an 8-bit machine. Alternative shells are planned for the future and will be announced as they become available.
As the primary mechanism for working with A2osX, the shell (SH) is launched automatically when you log into A2osX. In the case where no ./ETC/PASSWD file is present, A2osX automatically logs you in as the ROOT user. When a user login occurs and SH is launched, it looks for a file called PROFILE in the users HOME directory and if found, executes that script. The information below on writing scripts applies to PROFILE script files.
As the primary mechanism for working with A2osX, the shell (**sh**) is launched automatically when you log into A2osX. In the case where no *./etc/passwd* file is present, A2osX automatically logs you in as the *root* user. When a user login occurs and **sh** is launched, it looks for a file called *profile* in the users HOME directory and if found, executes that script. The information below on writing scripts applies to PROFILE script files.
## Interacting with the Shell
To interact with the A2osX shell, you type commands at the prompt, which ends with a **$** character. The prompt usually includes your current working directory such as **/FULLBOOT/ROOT/$**. You can change the prompt by changing the **$PS1** variable (see below). At the **$** prompt you can enter any of the valid internal shell commands, an external program file name or a script file name. For external programs and scripts, A2osX will search in the directories specified in the **$PATH** variable and then in the current directory.
To interact with the A2osX shell, you type commands at the prompt, which ends with a **$** character. The prompt usually includes your current working directory such as **/fullboot/root/$**. You can change the prompt by changing the **$PS1** variable (see below). At the **$** prompt you can enter any of the valid internal shell commands, an external program file name or a script file name. For external programs and scripts, A2osX will search in the directories specified in the **$PATH** variable and then in the current directory.
### Special Keys
@ -53,178 +53,178 @@ Whether in scripts or typed in at the interactive Shell prompt ($), most command
command <switch> <value> <switch> argument argument or
command [ <condition> ]
where in the first nomenclature a **command** performs an action with or on the objects passed as *\<arguments\>*, modifying its behavior (the action it performs) based on *\<switches\>* if present. For example in the case of **LS -L /MYVOL** the command is **LS**, the option or switch is **-L** and the argument (target of the operation) is **/MYVOL**, which in this case the command would print a long listing of the root directory fo the ProDOS volume named /MYVOL. The second nomenclature is used with the logic/control commands **IF** and **WHILE** where a *\<condition\>* is evaluated and the result is processed by the command to effect program flow.
where in the first nomenclature a **command** performs an action with or on the objects passed as *\<arguments\>*, modifying its behavior (the action it performs) based on *\<switches\>* if present. For example in the case of **ls -l /myvol** the command is **ls**, the option or switch is **-l** and the argument (target of the operation) is **/myvol**, which in this case the command would print a long listing of the root directory fo the ProDOS volume named /myvol. The second nomenclature is used with the logic/control commands **if** and **while** where a *\<condition\>* is evaluated and the result is processed by the command to effect program flow.
> A note on command line structure for internal and external commands: When passing a command a series of arguments, you must include a space between each argument. In addition, if a command has an option that requires an argument, there must also be a space between the option and its argument. For example, when using the READ command which has the -S -P and -N options, the -P and -N options both require an argument so the full use of the command would be **READ -S -N 3 -P "My Prompt" AVAR**. Do not use -N3 as you might in Linux or DOS as you will generate a Syntax Error and the command will fail to execute. Also note, for many commands the order of the arguments is important (i.e. CP sourcefile destfile, order critical), however the order of Options is not. **READ -S -N 3 -P "MyPrompt" AVAR** is the same as **READ -P "MyPrompt" AVAR -S -N 3 ** as well as **READ -S AVAR -N 3 -P "MyPrompt"**. What is critical here is that you **must** have a number immediately after -N and a string after -P which will be the prompt.
> A note on command line structure for internal and external commands: When passing a command a series of arguments, you must include a space between each argument. In addition, if a command has an option that requires an argument, there must also be a space between the option and its argument. For example, when using the READ command which has the -S -P and -N options, the -P and -N options both require an argument so the full use of the command would be **read -s -n 3 -p "My Prompt" avar**. Do not use -n3 as you might in Linux or DOS as you will generate a Syntax Error and the command will fail to execute. Also note, for many commands the order of the arguments is important (i.e. **cp** sourcefile destfile, the order is critical), however the order of options is not. **read -s -n 3 -p "MyPrompt" avar** is the same as **read -p "MyPrompt" avar -s -n 3 ** as well as **read -s avar -n 3 -p "MyPrompt"**. What is critical here is that you **must** have a number immediately after **-n** and a string after **-p** which will be the prompt.
### Arguments
As briefly discussed above, almost all commands take and most even require an argument which affects the command's behavior. For example the **SLEEP** command requires that you pass it an argument that indicates the amount of time to SLEEP. Arguments come in many forms; each of these is discussed here.
As briefly discussed above, almost all commands take and most even require an argument which affects the command's behavior. For example the **sleep** command requires that you pass it an argument that indicates the amount of time to SLEEP. Arguments come in many forms; each of these is discussed here.
#### \<conditions\>
The shell features a lot of built-in checks and comparisons called \<conditions\> throughout this guide. This particular form of an argument is used exclusively by the **IF** and **WHILE** commands where the \<condition\> is evaluated and result is used to control program flow with in the defined **IF-ELSE-FI** or **WHILE-LOOP** block. All conditions must be encloded with in brackets **[]**. In addition to the capabilities found in the extensive list of checks and comparisons listed below, conditional execution can be enhanced by negating with an ! in front of a condition and/or compounding with AND and OR between two or more conditions. The following scripts show examples of the possible conditions
The shell features a lot of built-in checks and comparisons called \<conditions\> throughout this guide. This particular form of an argument is used exclusively by the **if** and **while** commands where the \<condition\> is evaluated and result is used to control program flow with in the defined **if-else-fi** or **while-loop** block. All conditions must be enclosed with in brackets **[]**. In addition to the capabilities found in the extensive list of checks and comparisons listed below, conditional execution can be enhanced by negating with an ! in front of a condition and/or compounding with AND and OR between two or more conditions. The following scripts show examples of the possible conditions
can use while writing your own scripts.
> Note: The examples below make use of the **;** directive which allows you to put multiple statements on one line. So for example
IF [ condition ] ; ECHO result ; ELSE ; ECHO message ; FI
if [ condition ] ; echo result ; else ; echo message ; fi
> Is the same as
IF [ condition ]
ECHO result
ELSE
ECHO message
FI
if [ condition ]
echo result
else
echo message
fi
> The single line notation allows these sample scripts to be significantly shorter; their operation is not affected. Also note, you are not limited to a single command line between the IF/ELSE/FI statements. See the documentation of the IF command for more information.
The shell includes several "checks" that can be used to easily determine if certain \<conditions> are true or false. The format of a check is **[ -CHECK \<value> ]** where -CHECK is one **-D** (is a directory), **-E** (is a directory or a file), **-F** (is a file), **-I** (is an integer), **-N** (is a null), **-X** (is a defined function) or **-Z** (is not null) and where \<value> is a variable or literal on which to perform the check. This script demonstrates the usage of these "Check" Conditions.
The shell includes several "checks" that can be used to easily determine if certain \<conditions> are true or false. The format of a check is **[ -CHECK \<value> ]** where -CHECK is one **-d** (is a directory), **-e** (is a directory or a file), **-f** (is a file), **-i** (is an integer), **-n** (is a null), **-x** (is a defined function) or **-z** (is not null) and where \<value> is a variable or literal on which to perform the check. This script demonstrates the usage of these "Check" Conditions.
#!/bin/sh
#
# IF [ -CHECK <value> ] Examples
# if [ -CHECK <value> ] Examples
#
# Echo "Found" if their is a subdirectory TEST is in the current directory
# Echo "Found" if their is a subdirectory TEST in the current directory
# If TEST is not present, or is present but a file, this Check would fail
IF [ -D TEST ] ; ECHO "Found" ; FI
# If -D using a variable
SET FNAME = "TEST" ; IF [ -D $FNAME ] ; ECHO "Found" ; FI
if [ -d TEST ] ; echo "Found" ; fi
# If -d using a variable
set fname = "TEST" ; if [ -d $fname ] ; echo "Found" ; fi
# Echo "Found" if a file or a subdirectory named TEST is in the current directory
IF [ -E TEST ] ; ECHO "Found" ; FI
# Echo "Found" if the file PROFILE is in the top most directory of the volume MYVOL
# IF PROFILE were a directory name and not a file, this Check would fail
IF [ -F /MYVOL/PROFILE ] ; ECHO "Found" ; FI
# Echo "True" if the <value> is an Integer
SET ABC = 123 ; IF [ -I $ABC ] ; ECHO "True" ; FI ; # Would Echo True
SET ABC = "Hello" ; IF [ -I $ABC ] ; ECHO "True" ; FI ; # False no Echo
IF [ -I 123.456 ] ; ECHO "True" ; ELSE ; ECHO "False" ; FI ; # Echo False
# Note the next two -N and -Z are in affect opposites of each other ![ -N ] = [ -Z ]
# Echo "True" if the variable is not empty (non-null)
SET ABC = "Hello" ; IF [ -N $ABC ] ; ECHO "True" ; FI ; # True
# Echo "True" if a function named MYFUNC has been defined
if [ -e TEST ] ; echo "Found" ; fi
# Echo "Found" if the file profile is in the top most directory of the volume MYVOL
# IF profile were a directory name and not a file, this Check would fail
If [ -f /myvol/profile ] ; echo "Found" ; fi
# Echo "true" if the <value> is an Integer
set abc = 123 ; if [ -i $abc ] ; echo "true" ; fi ; # would echo true
set abc = "hello" ; if [ -i $abc ] ; echo "true" ; fi ; # false no echo
if [ -i 123.456 ] ; echo "true" ; else ; echo "false" ; fi ; # echo false
# Note the next two -n and -z are in affect opposites of each other ![ -n ] = [ -z ]
# Echo "true" if the variable is not empty (non-null)
set abc = "hello" ; if [ -n $abc ] ; echo "true" ; fi ; # true
# Echo "true" if a function named MYFUNC has been defined
# See the section on functions for more information on this check
IF [ -X MYFUNC ] ; ECHO "True" ; FI ; # False
# Echo "True" if the variable is empty/does not exist (null)
SET ABC = ; IF [ -Z $ABC ] ; ECHO "True" ; FI ; # True
SET ABC = "Hello" ; IF [ -Z $ABC ] ; ECHO "True" ; FI ; # False
if [ -x MYFUNC ] ; echo "true" ; fi ; # False
# Echo "true" if the variable is empty/does not exist (null)
set abc = ; if [ -z $abc ] ; echo "true" ; fi ; # true
set abc = "hello" ; if [ -z $abc ] ; echo "true" ; fi ; # false
>In case you are wondering why there appears to be extra semicolons (;) in the lines above, unlike other languages (i.e. C, BASH, VB) you cannot put a comment on the same line as a command. A comment must start with pound (#) at the start of a line. Remember from the note above, that the semicolon allows you to concatenate multiple lines onto one, but they are treated as separate lines. Here, that allows a comment to appear on the same line as executable statements, but to the shell its treated as its only line that starts with a #.
This script demonstrates the usage of the various String evaluation Conditions. They are equals (=), not equals (!=), less than (.<), less than or equal (<=), greater than (.>) and greater than or equal (>=).
This script demonstrates the usage of the various String evaluation Conditions. They are equals (**=**), not equals (**!=**), less than (**.<**), less than or equal (**<=**), greater than (**.>**) and greater than or equal **(>=**).
#!/bin/sh
#
# IF [ String <comparator> String ] <conditions> Examples
# if [ string <comparator> string ] <conditions> Examples
#
SET A = "ABC"
SET B = "DEF"
IF [ $A = $B ] ; ECHO HI ; ELSE ; ECHO BYE ; FI ; # False - BYE
IF [ $A != $B ] ; ECHO HI ; ELSE ; ECHO BYE ; FI ; # True - HI
IF [ $A .< $B ] ; ECHO HI ; ELSE ; ECHO BYE ; FI ; # True - HI
IF [ $A <= $B ] ; ECHO HI ; ELSE ; ECHO BYE ; FI ; # True - HI
IF [ $A .> $B ] ; ECHO HI ; ELSE ; ECHO BYE ; FI ; # False - BYE
IF [ $A >= $B ] ; ECHO HI ; ELSE ; ECHO BYE ; FI ; # False - BYE
set a = "abc"
set b = "def"
if [ $a = $b ] ; echo hi ; else ; echo bye ; fi ; # false - bye
if [ $a != $b ] ; echo hi ; else ; echo bye ; fi ; # true - hi
if [ $a .< $b ] ; echo hi ; else ; echo bye ; fi ; # true - hi
if [ $a <= $b ] ; echo hi ; else ; echo bye ; fi ; # true - hi
if [ $a .> $b ] ; echo hi ; else ; echo bye ; fi ; # false - bye
if [ $a >= $b ] ; echo hi ; else ; echo bye ; fi ; # false - bye
> Note if you set A = 123 and B = "DEF" and do those tests you will get an error on some of the tests since one of the variables is an integer and both variables should be strings.
> Note if you set A = 123 and B = "def" and do those tests you will get an error on some of the tests since one of the variables is an integer and both variables should be strings.
This script demonstrates the usage of the various Integer evaluation Conditions. They are equals (-eq), not equals (-ne), less than (-lt), less than or equal (-le), greater than (-gt) and greater than or equal (-ge).
This script demonstrates the usage of the various Integer evaluation Conditions. They are equals (**-eq**), not equals (**-ne**), less than (**-lt**), less than or equal (**-le**), greater than (**-gt**) and greater than or equal (**-ge**).
#!/bin/sh
#
# IF [ Int32 <comparator> Int32 ] <conditions> Examples
# if [ int32 <comparator> int32 ] <conditions> Examples
#
SET A = 123
SET B = 456
IF [ $A -eq $B ] ; ECHO HI ; ELSE ; ECHO BYE ; FI ; # False - BYE
IF [ $A -ne $B ] ; ECHO HI ; ELSE ; ECHO BYE ; FI ; # True - HI
IF [ $A -lt $B ] ; ECHO HI ; ELSE ; ECHO BYE ; FI ; # True - HI
IF [ $A -le $B ] ; ECHO HI ; ELSE ; ECHO BYE ; FI ; # True - HI
IF [ $A -gt $B ] ; ECHO HI ; ELSE ; ECHO BYE ; FI ; # False - BYE
IF [ $A -ge $B ] ; ECHO HI ; ELSE ; ECHO BYE ; FI ; # False - BYE
set a = 123
set b = 456
if [ $a -eq $b ] ; echo hi ; else ; echo bye ; fi ; # false - bye
if [ $a -ne $b ] ; echo hi ; else ; echo bye ; fi ; # true - hi
if [ $a -lt $b ] ; echo hi ; else ; echo bye ; fi ; # true - hi
if [ $a -le $b ] ; echo hi ; else ; echo bye ; fi ; # true - hi
if [ $a -gt $b ] ; echo hi ; else ; echo bye ; fi ; # false - bye
if [ $a -ge $b ] ; echo hi ; else ; echo bye ; fi ; # false - bye
> Note if you set A = 123 and B = "Hello" and do those tests you will get an error since one of the variables is string and both variables must be integers.
To help simplify scripts in some cases, you can modify any of the above \<conditions\> by preceding it with an exclamation (!) or NOT symbol. For instance you might have a script that creates a temporary file that normally would be stored in **${ROOT}TMP/**. Before attempting to create a file in this directory you might check to see if it exists and if not create it. This script would do that:
To help simplify scripts in some cases, you can modify any of the above \<conditions\> by preceding it with an exclamation (**!**) or NOT symbol. For instance you might have a script that creates a temporary file that normally would be stored in **${ROOT}tmp/**. Before attempting to create a file in this directory you might check to see if it exists and if not create it. This script would do that:
#!/bin/sh
#
# Check for TMP and create if missing
#
IF [ -D ${ROOT}/TMP ]
ELSE
MD ${ROOT}/TMP
FI
if [ -d ${ROOT}/tmp ]
else
md ${ROOT}/tmp
fi
Notice that the work being done here is in the ELSE block, or when the check fails. You may find it better to use the NOT (!) modifier and write the script this way:
Notice that the work being done here is in the **else** block, or when the check fails. You may find it better to use the NOT (**!**) modifier and write the script this way:
#!/bin/sh
#
# Check for TMP and create if missing
#
IF ![ -D ${ROOT}/TMP ]
MD ${ROOT}/TMP
FI
if ![ -d ${ROOT}/tmp ]
md ${ROOT}/tmp
fi
You can further extend \<conditions\> by building complex evaluations that consist of multiple check or comparison \<conditions\> joined by AND and/or OR. The following are examples using AND and OR.
You can further extend \<conditions\> by building complex evaluations that consist of multiple check or comparison \<conditions\> joined by **and** and/or **or**. The following are examples using **and** and **or**.
#!/bin/sh
#
# IF <conditions> with AND and OR Examples
# if <conditions> with and and or examples
#
SET A = 123
SET B = 456
# With AND you can test 2 or more things at once
IF [ $A -eq 123 ] AND [ $B -eq 456 ]
ECHO HI
ELSE
ECHO BYE
FI ; # True - HI
# Test that 3 conditions are ALL true
IF [ $A -eq 123 ] AND [ $B -eq 456 ] AND [ $C = "Your Name" ]
ECHO HI
ELSE
ECHO BYE
FI ; # False - BYE (because 3rd condition not met)
# With OR you can test if either condition is met
IF [ $A -eq 123 ] OR [ $B -eq 456 ]
ECHO HI
ELSE
ECHO BYE
FI ; # True - HI
IF [ $A -eq 999 ] OR [ $B -eq 456 ]
ECHO HI
ELSE
ECHO BYE
FI ; # True - HI (2nd condition is met)
set a = 123
set b = 456
# With and you can test 2 or more things at once
if [ $a -eq 123 ] and [ $b -eq 456 ]
echo hi
else
echo bye
fi ; # true - hi
# Test that 3 conditions are all true
if [ $a -eq 123 ] and [ $b -eq 456 ] and [ $c = "your name" ]
echo hi
else
echo bye
fi ; # false - bye (because 3rd condition not met)
# With or you can test if either condition is met
if [ $a -eq 123 ] or [ $b -eq 456 ]
echo hi
else
echo bye
fi ; # true - hi
if [ $a -eq 999 ] or [ $b -eq 456 ]
echo hi
else
echo bye
fi ; # true - hi (2nd condition is met)
When using multiple of these joiners with a single command such as **IF**, care should be made in the structuring of your \<condition\> statements. The shell processes command lines linearly from left to right and is very binary in nature. Consider first a math example of **SET A = 1 + 2 * 3 - 4 * 8 + 2 / 2**, the result placed into **A** is 42 (process the calculations like a calculator would, one at a time, there is no precedence). When evaluating a set of \<conditions\>, the shell processes them one at a time the same way and when it encounters an AND or an OR it evaluates the current "state" to determine if it should return a result or continue to evaluate the conditions ont he line. Let us say you have 4 conditions, A, B, C and D (each one represents something like [ -d adir ]), and you are doing something like IF A AND B OR C AND D. The Shell will determine a result for A (for example that [ -d adir]) and then it sees "AND", at that moment if A is false all processing ends there because it does not matter what else is on the command line (The IF fails). Now assume A and B are both true and it gets to that OR, again processing stops be cause there is already a true case on one side of the OR (The IF succeeds). As you can see, its easy to predict the behavior of constructs like IF A and B and C and D (all must be true) as well as IF A or B or C (any one need be true), but complex IF A or B and C or D and E need to be tested that they perform as you imagined. Once mastered though, you will see that when structured correctly you can perform very complex \<condition\> sets. Say you wanted to do IF ( A and B ) or C, realizing there is no actual groupings (parens) in conditions, if you simply structure your if as IF C OR A AND B, it will have the effect you wanted. There is an example of complex compound conditions that you can run and even modify to test different patterns/structures of complex conditions. It can be found at **[ANDORTESTS](../EXAMPLES/ANDORTESTS.txt)**.
When using multiple of these joiners with a single command such as **if**, care should be made in the structuring of your \<condition\> statements. The shell processes command lines linearly from left to right and is very binary in nature. Consider first a math example of **set A = 1 + 2 * 3 - 4 * 8 + 2 / 2**, the result placed into **A** is 42 (process the calculations like a calculator would, one at a time, there is no precedence). When evaluating a set of \<conditions\>, the shell processes them one at a time the same way and when it encounters an **and** or an **or** it evaluates the current "state" to determine if it should return a result or continue to evaluate the conditions on the line. Let us say you have 4 conditions, A, B, C and D (each one represents something like [ -d adir ]), and you are doing something like IF A AND B OR C AND D. The Shell will determine a result for A (for example that [ -d adir]) and then it sees "AND", at that moment if A is false all processing ends there because it does not matter what else is on the command line (The **if** fails). Now assume A and B are both true and it gets to that OR, again processing stops be cause there is already a true case on one side of the OR (The IF succeeds). As you can see, its easy to predict the behavior of constructs like IF A and B and C and D (all must be true) as well as IF A or B or C (any one need be true), but complex IF A or B and C or D and E need to be tested that they perform as you imagined. Once mastered though, you will see that when structured correctly you can perform very complex \<condition\> sets. Say you wanted to do IF ( A and B ) or C, realizing there is no actual groupings (parens) in conditions, if you simply structure your if as IF C OR A AND B, it will have the effect you wanted. There is an example of complex compound conditions that you can run and even modify to test different patterns/structures of complex conditions. It can be found at **[ANDORTESTS](../EXAMPLES/ANDORTESTS.txt)**.
#### \<expression\>
The A2osX shell contains an expression evaluator that can perform simple integer math operations using the **\+ \- \* \/** and **MOD** operators. Expressions are a form of an argument used by only a handful of commands, most notably SET (to store the result of the expression into a variable) and CASE/SWITCH.
The A2osX shell contains an expression evaluator that can perform simple integer math operations using the **\+ \- \* \/** and **mod** operators. Expressions are a form of an argument used by only a handful of commands, most notably **set** (to store the result of the expression into a variable) and **case/switch**.
#!/bin/sh
#
# Shell Expressions Example
#
SET A = 123
SET B = 10
SET C = A + B # 133
SET C = A - B # 113
SET C = A * B # 1230
SET C = A / B # 12
SET C = A MOD B # 3
SET C = 100 * 2 / 4 + 2 / 13 * 4 # 16
set a = 123
set b = 10
set c = a + b # 133
set c = a - b # 113
set c = a * b # 1230
set c = a / b # 12
set c = a mod b # 3
set c = 100 * 2 / 4 + 2 / 13 * 4 # 16
#### \<op\>
\<Op\> are operators, the simple integer math functions that can be performed in the shell. They are a special kind of argument used only in \<Expressions\>, see above. The valid \<Ops\> are \+ (addition) \- (subtraction) \* (multiplication) \/ (division) and MOD. See the script above in the \<expression> section for examples of \<ops>.
\<Op\> are operators, the simple integer math functions that can be performed in the shell. They are a special kind of argument used only in \<Expressions\>, see above. The valid \<Ops\> are **\+** (addition) **\-** (subtraction) \* (multiplication) \/ (division) and **mod**. See the script above in the \<expression> section for examples of \<ops>.
#### \<switch\>
A switch is a special type of argument to internal and external commands that changes the behavior of that command. For instance, the standard ECHO command ends its output with a carriage return (ASCII 13), adding the -N switch to ECHO (i.e. ECHO -N "Hello") will cause ECHO to omit the CR. All switches begin with hyphen (-) and are immediately followed by a valid single character (in the case of ECHO -N is the only valid switch) and then a space (or carriage return if the end of the line). There should be no space between the hyphen (-) and the switch character, and if the switch itself requires an argument, then switch must be followed by a space and then the argument for that switch (see the READ command for an example). Please make sure you read the note at the start of this section regarding command line structure and the ordering of arguments, in particular with switches that themselves require arguments.
A switch is a special type of argument to internal and external commands that changes the behavior of that command. For instance, the standard **echo** command ends its output with a carriage return (ASCII 13), adding the **-n** switch to **echo** (i.e. **echo -n "hello"**) will cause **echo** to omit the *CR*. All switches begin with hyphen (-) and are immediately followed by a valid single character (in the case of **echo** **-n** is the only valid switch) and then a space (or carriage return if the end of the line). There should be no space between the hyphen (-) and the switch character, and if the switch itself requires an argument, then the switch must be followed by a space and then the argument for that switch (see the **read** command for an example). Please make sure you read the note at the start of this section regarding command line structure and the ordering of arguments, in particular with switches that themselves require arguments.
#### \<value\>
@ -234,39 +234,39 @@ Please note, that the shell does string substitution when processing \<values>.
### AND
[ <expression> ] AND [ <expression> ]...
[ <expression> ] and [ <expression> ]...
The **AND** reserved word is used to join 2 or more conditions together to create complex logic statements. See \<condition\> section above for more information on **AND** and examples of its usage. In addition, look at **[ANDORDEMO](EXAMPLES/ANDORDEMO.txt)**, a complete script using **AND** and **OR**.
The **and** reserved word is used to join 2 or more conditions together to create complex logic statements. See \<condition\> section above for more information on **and** and examples of its usage. In addition, look at **[ANDORDEMO](EXAMPLES/ANDORDEMO.txt)**, a complete script using **and** and **or**.
### BREAK
BREAK
break
The **BREAK** command is used to exit or end a block of statements that were optionally executed for a particular **CASE** as part of a **SWITCH** script block. See the **SWITCH** command below for more information and example of using **BREAK**.
The **break** command is used to exit or end a block of statements that were optionally executed for a particular **case** as part of a **switch** script block. See the **switch** command below for more information and example of using **break**.
### CALL
CALL function [ <argument> ]...
call function [ <argument> ]...
The **CALL** command is used to execute a previously defined and loaded function. When calling a function with the **CALL** command, you may pass one or more arguments which can then be used by the function during execution. See the **FUNCTION** command below for more information on creating and calling functions including examples.
The **call** command is used to execute a previously defined and loaded function. When calling a function with the **call** command, you may pass one or more arguments which can then be used by the function during execution. See the **function** command below for more information on creating and calling functions including examples.
### CASE
CASE <expression>
case <expression>
The **CASE** command is used at the start of a block of statements to be optionally executed based on the evaluation of \<expression\> as part of a **SWITCH** script block. See the **SWITCH** command below for more information and example of using **CASE**.
The **case** command is used at the start of a block of statements to be optionally executed based on the evaluation of \<expression\> as part of a **switch** script block. See the **switch** command below for more information and example of using **case**.
### CD
CD <value>
cd <value>
The **CD** command is used to change the current working directory. You must supply the **CD** command a valid relative or absolute path. Examples of relative paths include SUBDIR1 (a sub-directory in the current directory), ../SUBDIR2 (a sub-directory in the parent of the current directory), and SUBDIR1/SUBDIR3 ( a sub-directory in the sub-directory SUBDIR1 of the current directory). An absolute path always begins with a / and includes the volume name of the disk drive to which change the current working directory such as /MYVOL1/VAR/LOGS (the sub-directory LOGS in the directory VAR on the disk with a volume label of MYVOL1). You can use the **PWD** command to display the current working directory if your prompt (**$**) does not automatically display it on the command line (the default, set in your PROFILE). The current working directory is used my the shell to look for scripts not located in one of the directories specified by **$PATH** or as the directory for reading and writing files when no path is provided by a command. For example, if you execute the **LS** command without arguments, **LS** assumes to list the files in the current working directory. Similarly, if you specify a file without a path, for example the command **ECHO Hello > outfile**, shell will place the file outfile in the current working directory. See the related **POPD** and **PUSHD** commands.
The **cd** command is used to change the current working directory. You must supply the **cd** command a valid relative or absolute path. Examples of relative paths include *subdir1* (a sub-directory in the current directory), *../subdir2* (a sub-directory in the parent of the current directory), and *subdir1/subdir3* ( a sub-directory in the sub-directory *subdir1* of the current directory). An absolute path always begins with a / and includes the volume name of the disk drive to which change the current working directory such as */MYVOL1/var/logs* (the sub-directory *logs* in the directory *var* on the disk with a volume label of *MYVOL1*). You can use the **pwd** command to display the current working directory if your prompt (**$**) does not automatically display it on the command line (the default, set in your *PROFILE*). The current working directory is used by the shell to look for scripts not located in one of the directories specified by **$PATH** or as the directory for reading and writing files when no path is provided by a command. For example, if you execute the **ls** command without arguments, **ls** assumes to list the files in the current working directory. Similarly, if you specify a file without a path, for example the command **echo Hello > outfile**, shell will place the file *outfile* in the current working directory. See the related **popd** and **pushd** commands.
### DATE
DATE [ <expression> ]
date [ <expression> ]
The **DATE** command outputs the current date and time. A supported clock card is needed to return accurate DATE and TIME values. **DATE** accepts an optional \<expression> that should be a string that can contain any text as well as the following format options:
The **date** command outputs the current date and time. A supported clock card is needed to return accurate DATE and TIME values. **date** accepts an optional \<expression> that should be a string that can contain any text as well as the following format options:
- %a : Abbreviated weekday name : Thu
- %A : Full weekday name : Thursday
- %b : Abbreviated month name : Aug
@ -286,168 +286,208 @@ The following script highlights sample \<expressions> you can pass the **DATE**
#!/bin/sh
#
# DATE Command Examples
# date Command Examples
#
DATE ' Wednesday, November 20 2019 22:53:00
DATE "Time: %I:%M %p" ' Time: 10:53 PM
DATE "Today is %A %B %d %Y" ' Today is Wednesday November 20 2019
DATE "%b-%d-%y" ' Nov-20-19
date ' Wednesday, November 20 2019 22:53:00
date "Time: %I:%M %p" ' Time: 10:53 PM
date "Today is %A %B %d %Y" ' Today is Wednesday November 20 2019
date "%b-%d-%y" ' Nov-20-19
### DEFAULT
DEFAULT
default
The **DEFAULT** commands is used to select the block of commands to execute for the Default Case for the **SWITCH** command. Structured appropriately, the commands after the **DEFAULT** keyword are executed when no other **CASE** was valid. See the section on **CASE** and **SWITCH** for more information and complete examples for creating your own **SWITCH** execution blocks.
The **default** commands is used to select the block of commands to execute for the Default Case for the **switch** command. Structured appropriately, the commands after the **default** keyword are executed when no other **CASE** was valid. See the section on **case** and **switch** for more information and complete examples for creating your own **switch** execution blocks.
### ECHO
ECHO [-N] <value>...
echo [-n] <value>...
The **ECHO** command is used to print <values> to an output device, by default the screen. The **ECHO** command optional switch **-N** causes **ECHO** to suppress output of the carriage return that normally occurs. Technically the format of the ECHO command is **ECHO [-N] [\<value\> ...]**. This means that the ECHO command can be followed by the optional switch -N and one or more optional \<values\>. In the case of ECHO, it is these \<values\> that are output by the command. Here, values are separated by spaces, so you can do ECHO $A HELLO $B and echo will output the value stored in the variable A and then the world HELLO and then the value stored in B. Please see \<values> for more information on how values are processed, especially in the handling of variables ($VAR) contained in a \<value>.
The **echo** command is used to print <values> to an output device, by default the screen. The **echo** command optional switch **-n** causes **echo** to suppress output of the carriage return that normally occurs. Technically the format of the **echo** command is **echo [-n] [\<value\> ...]**. This means that the **echo** command can be followed by the optional switch **-n** and one or more optional \<values\>. In the case of **echo**, it is these \<values\> that are output by the command. Here, values are separated by spaces, so you can do ECHO $A HELLO $B and echo will output the value stored in the variable A and then the world HELLO and then the value stored in B. Please see \<values> for more information on how values are processed, especially in the handling of variables ($VAR) contained in a \<value>.
A word about values, command lines and spaces: **ECHO Hello World** is not the same as **ECHO "Hello World"**. In the first case ECHO treats Hello and World as separate values and in the second, "Hello World" as one value. Since ECHO takes multiple values, you might not notice the difference, but in the case of **IF [ $A = "Hello World" ]** if you omitted the quotes you would get a syntax error because the = operator only accepts one value on each side. In addition, when not enclosed in quotes, extra spaces are removed so **ECHO Hello&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;World** would be output as **Hello World** as ECHO would treat Hello and World as values and output value space value.
A word about values, command lines and spaces: **echo Hello World** is not the same as **echo "Hello World"**. In the first case **echo** treats Hello and World as separate values and in the second, "Hello World" as one value. Since **echo** takes multiple values, you might not notice the difference, but in the case of **if [ $A = "Hello World" ]** if you omitted the quotes you would get a syntax error because the = operator only accepts one value on each side. In addition, when not enclosed in quotes, extra spaces are removed so **echo Hello&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;World** would be output as **Hello World** as **echo** would treat Hello and World as values and output value space value.
In addition to the usual variable substitution that occurs with \<values> (see \<value> above), the **ECHO** command performs some special character substitutions while sending output to the screen or terminal. If placed inside a value like a string, **ECHO** will automatically substitute a backspace for the sequence **\b**, substitute an escape for **\e**, clear the screen for **\f**, send a newline for **\n**, send a \ for **\\\\** and send a % for **\\%**. The **\e** (escape) code is useful for sending VT100 escape sequences to the screen/terminal (see the VT100 example script). The **\\\\** and **\\%** are necessary to send those chars to the screen since normally those characters are interpreted as special command line arguments. There is also a special **\xHH** option, that will send explicitly the char represented by the HEX value HH to the output device (screen or file).
In addition to the usual variable substitution that occurs with \<values> (see \<value> above), the **echo** command performs some special character substitutions while sending output to the screen or terminal. If placed inside a value like a string, **echo** will automatically substitute a backspace for the sequence **\b**, substitute an escape for **\e**, clear the screen for **\f**, send a newline for **\n**, send a \ for **\\\\** and send a % for **\\%**. The **\e** (escape) code is useful for sending VT100 escape sequences to the screen/terminal (see the VT100 example script). The **\\\\** and **\\%** are necessary to send those chars to the screen since normally those characters are interpreted as special command line arguments. There is also a special **\xHH** option, that will send explicitly the char represented by the HEX value HH to the output device (screen or file).
#!/bin/sh
#
# ECHO Command Examples
# echo Command Examples
#
ECHO Hello World 'Hello World #Note SH treats as 2 <values>
ECHO "Hello World" 'Hello World
ECHO \f 'Clears Screen
ECHO "\fHello" 'Clears Screen puts Hello on first line
ECHO "\n\nHello' 'Sends to Carraige Returns then Hello to output
SET A$ = HELLO
ECHO A$ 'HELLO
ECHO "$A, How are you?" 'HELLO, How are you?
ECHO "$AB, fine!" ', fine! #Note AB is not defined
ECHO "${A}B, fine!" 'HELLOB, fine! #Brackets ensure A substitution
ECHO "123\b\b456" '1456 #two backspaces (\b) over the 23
ECHO -N "\xFF\xFF" > afile 'Create file called afile and put exactly the
echo Hello World 'Hello World #Note SH treats as 2 <values>
echo "Hello World" 'Hello World
echo \f 'Clears Screen
echo "\fHello" 'Clears Screen puts Hello on first line
echo "\n\nHello' 'Sends to Carraige Returns then Hello to output
set A$ = HELLO
echo A$ 'HELLO
echo "$A, How are you?" 'HELLO, How are you?
echo "$AB, fine!" ', fine! #Note AB is not defined
echo "${A}B, fine!" 'HELLOB, fine! #Brackets ensure A substitution
echo "123\b\b456" '1456 #two backspaces (\b) over the 23
echo -N "\xFF\xFF" > afile 'Create file called afile and put exactly the
'bytes Hex FF and Hex FF into it.
Consult the subsection below on Advanced Display Techniques for more examples of using **ECHO** and additional VT100 escape sequences that can be used to control the display of output.
Consult the subsection below on Advanced Display Techniques for more examples of using **echo** and additional VT100 escape sequences that can be used to control the display of output.
#### Advanced Display Techniques
A2osX provides advanced screen handling capabilities for the Apple console (keyboard/screen) as well as terminals connected directly (via Super Serial Cards) or remotely (via Telnet using a supported network card and the TELNETD server daemon). These features are based on the VT100 Terminal definition and scripts you develop can pass VT100 codes (via the ECHO command) to enhance the appearance of your scripts. In addition to VT100 codes, ECHO has been augmented with some short codes to perform the more common and to help display special characters. The examples below will help you understand what is possible with ECHO. For a fuller listing of the available VT100 Terminal Codes, consult the **[A2osX Terminal Codes Guide](.Docs/TERM.md).**
A2osX provides advanced screen handling capabilities for the Apple console (keyboard/screen) as well as terminals connected directly (via Super Serial Cards) or remotely (via Telnet using a supported network card and the **telnetd** server daemon). These features are based on the VT100 Terminal definition and scripts you develop can pass VT100 codes (via the **echo** command) to enhance the appearance of your scripts. In addition to VT100 codes, **echo** has been augmented with some short codes to perform the more common and to help display special characters. The examples below will help you understand what is possible with **echo**. For a fuller listing of the available VT100 Terminal Codes, consult the **[A2osX Terminal Codes Guide](.Docs/TERM.md).**
#!/bin/sh
# ECHO / Advanced Display Techniques Examples
# Note codes are CASE SENSITVE. \F is not the same as \f
# Clear the Screen (\f)
ECHO \f
echo \f
# Clear the Screen and Display text in the top left corner
ECHO "\fThis line will appear on the first line of your Apple"
echo "\fThis line will appear on the first line of your Apple"
# ECHO on a line byself will create a blank line (moving the cursor down one line)
# Multiple ECHOs in a row, will skip multiple lines. The \n shortcode makes this easier.
# This example is the same as ECHO; ECHO; ECHO "HELLO"; ECHO; ECHO; ECHO "WORLD"
ECHO "\n\nHELLO\n\nWORLD"
echo "\n\nHELLO\n\nWORLD"
# Backspace shortcode \b moves the cursor one space to the left.
# This example would print ABEF on the screen. The two \b overwrite the CD.
ECHO "ABCD\b\bEF"
echo "ABCD\b\bEF"
# Turn Inverse on: \e[7m off: \e[0m
# This example displays HELLO INVERSE WORLD with the word INVERSE in inverse.
ECHO "HELLO \e[7mINVERSE\e[0m WORLD"
echo "HELLO \e[7mINVERSE\e[0m WORLD"
# Print a backslash (\). Since \ is a special character, you need a way to print it.
ECHO "\\"
echo "\\"
# Print a percent (%). Since % is a special character, you need a way to print it.
ECHO "\%"
echo "\%"
# Supress Newline (-N). ECHO -N allows you to print multiple things on the same line
# This code segment will print ONE TWO THREE all on one line.
ECHO -N ONE
ECHO -N TWO
ECHO -N THREE
echo -N ONE
echo -N TWO
echo -N THREE
# Move cursor to beginning of current line (\r)
# This example will print WORLD HELLO, note spaces.
ECHO " HELLO\rWORLD"
echo " HELLO\rWORLD"
# Scroll Screen Down 1 Line (\eM)
ECHO \eM
echo \eM
# Scroll the Screen Up 1 Line (\eD)
ECHO \eD
echo \eD
# Clear Screen VT100 Code alternative, same as \f (\ec)
ECHO \ec
echo \ec
# Move cursor to [x,y] \e[x;yH
# Move cursor to row 5 and col 15 and print I AM HERE
ECHO "\e[05;15HI AM HERE"
echo "\e[05;15HI AM HERE"
# Move to home position [0,0] (\e[H)
ECHO \e[H
echo \e[H
# Clear from cursor to end of line (\e[K)
ECHO \e[K
echo \e[K
# Clear from cursor to beginning of line (\e[1K)
ECHO \e[1K
echo \e[1K
# Clear line (\e[2K)
ECHO \e[2K
echo \e[2K
# Clear line 15
ECHO \e[15;01H\e[2K
echo \e[15;01H\e[2K
### ELSE
ELSE
else
The **ELSE** command is used to add an optional branch to an **IF** block. See the **IF** command below for more information and examples of using **ELSE** as part of **IF** program blocks.
The **else** command is used to add an optional branch to an **if** block. See the **if** command below for more information and examples of using **else** as part of **if** program blocks.
### END
END
end
The **END** command is used at the end of a **SWITCH** script block. See the **SWITCH** command below for more information and example of using **END** as part of **SWITCH**.
The **end** command is used at the end of a **switch** script block. See the **switch** command below for more information and example of using **end** as part of **switch**.
### EXIT
EXIT [int32]
exit [int32]
The **EXIT** command is used to immediately end the processing of a script or function. **EXIT** accepts an optional argument that sets the return code (**$?**) which may be checked by a calling script. If no argument is provided the return code is set to 0 (No Error). The following script demonstrating the use of the EXIT command can be found in the [EXAMPLES](../EXAMPLES) folder.
The **exit** command is used to immediately end the processing of a script or function. **exit** accepts an optional argument that sets the return code (**$?**) which may be checked by a calling script. If no argument is provided the return code is set to 0 (No Error). The following script demonstrating the use of the **exit** command can be found in the [EXAMPLES](../EXAMPLES) folder.
#!/bin/sh
#
# EXIT Command Examples
# exit Command Examples
#
# This example shows the use of EXIT from a function with a return code
#
FUNCTION DIVIDE
function divide
{
IF ![ -I $A ] AND ![ -I $B ]
# Error not vars not integers
EXIT 3
FI
IF [ $B -EQ 0 ]
if ![ -i $1 ] and ![ -i $2 ]
# Error vars not integers
exit 3
fi
if [ $2 -eq 0 ]
# Error Zero Divisor
EXIT 7
FI
SET $3 = $A / $B
exit 7
fi
set $3 = $1 / $2
}
READ -P "\nEnter a number: " $A
READ -P "\nAnother number: " $B
CALL DIVIDE $A $B C
SWITCH $?
CASE 0
ECHO "\n$A divided by $B is $C\n"
BREAK
CASE 3
ECHO "\nError: Input not Integers\n"
BREAK
CASE 7
ECHO "\nError: Divide by Zero Prohibitied\n"
BREAK
END
read -p "\nEnter a number: " $A
read -p "\nAnother number: " $B
call divide $A $B C
switch $?
case 0
echo "\n$A divided by $B is $C\n"
break
case 3
echo "\nError: Input not Integers\n"
break
case 7
echo "\nError: Divide by Zero Prohibitied\n"
break
end
>Besides the **EXIT** command, the example above also demonstrates how to check that input is a number rather then a string (-I), using newlines (\n) to properly format the screen (the READ command leaves the cursor on the line of input), and passing a variable name to a function (this is a clever way to get return values from commands).
>Besides the **exit** command, the example above also demonstrates how to check that input is a number rather then a string (***-i***), using newlines (**\n**) to properly format the screen (the **read** command leaves the cursor on the line of input), and passing a variable name to a function (this is a clever way to get return values from commands).
### FI
FI
fi
The **FI** command is used at the end of an **IF** script block. See the **IF** command below for more information and example of using **FI** as part of **IF**.
The **fi** command is used at the end of an **if** script block. See the **if** command below for more information and example of using **fi** as part of **if**.
### FOR
FOR
for
The **FOR** command is used
#!/bin/sh
#
# for Command Examples
#
# This example shows the use of various for command blocks
#
# for example 1: for with static string list
#
# the following would output the 5 names on 5 lines
for name in "Alex Bert Dan Fred Mike Tom"
echo $name
next
#
# for example 2: for with list in variable
set names = "Alex Bert Dan Fred Mike Tom"
for name in $names
echo $name
next
#
# for example 3: for with list in stored in a file
# here, for reads the file names and sets the variable name to each line read
for name in (names)
echo $name
next
#
# for example 4: for with list from simple command
# this scriptlet copies the files in the current directory to the disk /backup
for name in `ls`
cp $name /backup
next
#
# for example 5: for with complex command
# this scriptlet reports of the total number of disk blocks used by all online volumes
set total = 0
for used in `ls -l / | cut -m 34 -n 39`
set total = $total + $used
next
echo "Total File System Used Blocks: ${total}"
### FUNCTION
FUNCTION function_name
@ -833,7 +873,7 @@ You add comments to your scripts by placing a pound sign at the start of the lin
In addition to the scripts in this document, there are many example scripts included with A2osX which can be found on the A2osX repository on GitHub. Besides the [EXAMPLES](../EXAMPLES) folder, you may also want to look at the scripts in the [TESTS](../TESTS), [MAKE](../MAKE) and [ADMIN](../ADMIN) folders. The scripts in the **TESTS** folder are used to test the various commands of A2osX with each release. The **MAKE** folder contains scripts used to make the published disk images for A2osX. The **ADMIN** folder contains scripts that are in the development stage that one day might be used to help administer an A2osX installation. All of these are good for learning the capabilities available to the script developer.
## License
A2osX is licensed under the GNU General Pulic License.
A2osX is licensed under the GNU General Public License.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
# A2osX User Guide
### Updated November 14, 2019
### Updated December 16, 2019
This Guide provides information on getting started with A2osX. This Guide helps you understand the basic features, capabilities and operation of A2osX. This should be the first document you read before, or soon after, installing or running A2osX.
@ -10,29 +10,29 @@ It is a new operating environment, layered on top of ProDOS, that brings a power
Part of what makes A2osX different, is that all programs, utilities, drivers and libraries are made re-entrant and relocatable so that they can be run concurrently and do not depend on a set memory location. One of the clear benefits is that multiple users can run the same program and it is only loaded once, and more significantly, drivers and libraries for resources such as networking are only loaded once and can be used my multiple applications at the same time.
A2osX is already much more then a "primitive" command line operating system. While A2osX runs on top of ProDos, leveraging its support for block devices such as floppy drives, hard drives, SmartPort drives, etc.; it adds a preemptive multitasking kernel with a greatly enhanced shell that supports arguments, redirection, piping, and probably the biggest enhancement, a full scripting language. In addition, at its core, the A2osX supports multiple virtual terminals (i.e. OA-1 OA-2 gets you different sessions) as well as concurrent external terminals via SSC (getty on SSC serial) or network (TELNETD). A GUI interface is being built and will be part of a future release.
A2osX is already much more then a "primitive" command line operating system. While A2osX runs on top of ProDos, leveraging its support for block devices such as floppy drives, hard drives, SmartPort drives, etc.; it adds a preemptive multitasking kernel with a greatly enhanced shell that supports arguments, redirection, piping, and probably the biggest enhancement, a full scripting language. In addition, at its core, the A2osX supports multiple virtual terminals (i.e. OA-1 OA-2 gets you different sessions) as well as concurrent external terminals via SSC (**getty** on SSC serial) or network (**telnetd**). A GUI interface is being built and will be part of a future release.
A core element at the foundation of A2osX that enables its multi-user multitasking capabilities is its reusable set of APIs and Libraries (written in Assembly) that all programs can and do use that make them very lean and fast. For instance, there is one network API that any program can call which in turn handles the I/O to different LAN cards via drivers. A significant feature is that multiple programs can be using the network at the same time such as the TELNETD server, the HTTPD server and/or the TELNET client. A key benefit is that the code for doing each program is smaller because the network API is doing a lot of the work. And since CORE APIs like printf and libraries such as Network loaded only once, much like a DLL in Windows, significant memory is conserved providing the resources needed to support multitasking and multiple users.
A core element at the foundation of A2osX that enables its multi-user multitasking capabilities is its reusable set of APIs and Libraries (written in Assembly) that all programs can and do use that make them very lean and fast. For instance, there is one network API that any program can call which in turn handles the I/O to different LAN cards via drivers. A significant feature is that multiple programs can be using the network at the same time such as the **telnetd** server, the **httpd** server and/or the **telnet** client. A key benefit is that the code for doing each program is smaller because the network API is doing a lot of the work. And since CORE APIs like printf and libraries such as Network loaded only once, much like a DLL in Windows, significant memory is conserved providing the resources needed to support multitasking and multiple users.
The core of A2osX is written entirely in 65C02 Assembly and built using the S-C Macro Assembler. Assembly was chosen because at end of day it provides for the most strict and stringent memory management as well as the fastest performance of any language on the Apple II. Work is underway to provide ASM running under A2osX (see Current and Future Development Process sections below). There is also an entire shell scripting language (see below) and in the future we plan a CSH (C-Shell) which is the first step to an Interactive C interpreter and then a Compiler that will make C feed to built-in assembler. Yes, that is a lot on our development plan, but the only way to make it feasible is by building the core using assembly to provide enough memory and processing sources to enable such features.
The core of A2osX is written entirely in 65C02 Assembly and built using the S-C Macro Assembler. Assembly was chosen because at end of day it provides for the most strict and stringent memory management as well as the fastest performance of any language on the Apple II. Work is underway to provide **asm** running under A2osX (see Current and Future Development Process sections below). There is also an entire shell scripting language (see below) and in the future we plan a **csh** (C-Shell) which is the first step to an Interactive C interpreter and then a Compiler that will make C feed to built-in assembler. Yes, that is a lot on our development plan, but the only way to make it feasible is by building the core using assembly to provide enough memory and processing sources to enable such features.
### Developing for A2osX
There has been a significant uptick in interest in A2osX and its development. That's great! Along with that has come a lot of questions and requests for documentation. Besides this new user guide, which we hope will answer many of your questions, we have also written an extensive **[Developers Guide](.Docs/Developers%20Guide.md).** That guide explains our current development process (GitHub to delivery media) as well as our future plans.
The Developers Guide is all about developing the core of A2osX, its drivers, utilities, libraries, etc. that is all done in Assembly. There is another aspect of A2osX that will interest many developers and users alike and that is its significant scripting engine or Shell (./BIN/SH).
The Developers Guide is all about developing the core of A2osX, its drivers, utilities, libraries, etc. that is all done in Assembly. There is another aspect of A2osX that will interest many developers and users alike and that is its significant scripting engine or Shell (*./bin/sh*).
### The A2osX Shell (SH)
One of the most significant parts of A2osX is its shell which can perform both interactive and scripted tasks. With the interactive part of the shell you can perform many common and complex tasks using both built-in (native or internal to shell) and external (BINs or executables) commands. Internal commands include CD (change directory), MD (make directory), DATE, TIME, etc. External commands include CP (copy), RM (remove), CAT (display file contents), TELNET, etc.
One of the most significant parts of A2osX is its shell which can perform both interactive and scripted tasks. With the interactive part of the shell you can perform many common and complex tasks using both built-in (native or internal to shell) and external (BINs or executables) commands. Internal commands include **cd** (change directory), **md** (make directory), **date**, **echo**, etc. External commands include **cp** (copy), **rm** (remove), **cat** (display file contents), **telnet**, etc.
It should be noted, that it is possible to create and execute short scripts right on the interactive command line (these are run once and not saved like true scripts). An example
```
FOR FILE IN `LS -C CT*`; CAT ${FILE}; NEXT
for file in `ls -c ct*`; cat ${file}; next
```
In this example, the system will generate a list of files found in the current directory that match the CT* wildcard and perform the CAT operation on each. The semicolons act as a line separator allowing you to type in multiple commands, or short scripts, to execute as an inline script.
In this example, the system will generate a list of files found in the current directory that match the CT* wildcard and perform the **cat** operation on each. The semicolons act as a line separator allowing you to type in multiple commands, or short scripts, to execute as an inline script.
An entire Shell Developers Guide is being written to help you with both using and writing scripts for the A2osX Shell. It can be found **[Here](.Docs/Shell%20Developers%20Guide.md).**
@ -42,11 +42,11 @@ To get the most out of the use of files and directories you need to understand t
A2osX organizes information in files and directories. A directory is a special file that can contain other files and directories. Because a directory can contain other directories, this method of organizing files gives rise to a hierarchical structure. This organization of files is the file system.
Folks who use and are accustomed to working with Linux or Unix will find familiarity with A2osX. Many of the commands and much of the Shell interface follows the User Interface (UI) presented by Linux. There is however, one key difference, that makes A2osX adhere more to the ProDOS model which is the support for multiple distinct volumes. In Linux there is only one root represented by / (typically the boot volume) with all other drives appearing as sub directories of this volume. A2osX instead continues to present each volume separately by their name as does ProDOS. A2osX does present a BOOT/SYSTEM directory (where A2OSX.SYSTEM was loaded from) and uses this for finding critical system directories and files such as BIN and ETC.
Folks who use and are accustomed to working with Linux or Unix will find familiarity with A2osX. Many of the commands and much of the Shell interface follows the User Interface (UI) presented by Linux. There is however, one key difference, that makes A2osX adhere more to the ProDOS model which is the support for multiple distinct volumes. In Linux there is only one root represented by / (typically the boot volume) with all other drives appearing as sub directories of this volume. A2osX instead continues to present each volume separately by their name as does ProDOS. A2osX does present a BOOT/SYSTEM directory (where *A2OSX.SYSTEM* was loaded from) and uses this for finding critical system directories and files such as *bin* and *etc*.
You move around the file sytesm with CD and PWD will tell you were you are. Your default prompt includes your current path.
You move around the file sytesm with **cd** and **pwd** will tell you were you are. Your default prompt includes your current path.
The following are the primary sub-directories used by A2osX. While A2osX supports all standard ProDOS media/volumes and you can use its commands and utilities (like cp [copy] ls [catalog] rm [delete]) on these volumes, A2osX and its modules, commands, scripts, etc. must be installed under one directory that has these directories (and their related files) stored under it. Below where you see a ./ (dot slash) in front of each path, think of that as the volume name or directory name where you have installed A2osX. For example, on the media we supplied called BOOT, which has a volume name of /A2OSX.BOOT/, you will find directories named BIN and ETC. The full path name for those dirs would be /A2OSX.BOOT/BIN/ and /A2OSX.BOOT/ETC/. If you installed A2OSX on your own hard drive called /MYVOL1 in a directory called A2OSX, then your ./ would refer to /MYVOL1/A2OSX/ and your BIN would be /MYVOL1/A2OSX/BIN/. See the installation section for more information on using A2osX with your own volumes.
The following are the primary sub-directories used by A2osX. While A2osX supports all standard ProDOS media/volumes and you can use its commands and utilities (like **cp** [copy] **ls** [catalog] **rm** [delete]) on these volumes, A2osX and its modules, commands, scripts, etc. must be installed under one directory that has these directories (and their related files) stored under it. Below where you see a ./ (dot slash) in front of each path, think of that as the volume name or directory name where you have installed A2osX. For example, on the media we supplied called *RELEASE.140.po*, which has a volume name of /miniboot/, you will find directories named *bin* and *etc*. The full path name for those dirs would be */miniboot/bin/* and */miniboot/etc/*. If you installed A2OSX on your own hard drive called */MYVOL1* in a directory called *A2OSX*, then your ./ would refer to */MYVOL1/A2OSX/* and your BIN would be */MYVOL1/A2OSX/bin/*. See the installation section for more information on using A2osX with your own volumes.
| Path | Use |
| ---- | --- |
@ -81,29 +81,28 @@ To help you install, configure, run and maintain your A2osX system, this section
First, let's walk through the most standard and likely boot process of A2osX using a volume names /A2OSX that is presented to the Apple as your boot drive (i.e. its a hard drive image that appears in Slot 7 as Drive 1, or its a floppy inserted in Drive 1 of the Slot 6 controller).
- PRODOS is loaded
- The first SYSTEM program found on the volume is loaded. Typically if you have a no slot clock (NSC), you will have NS.CLOCK.SYSTEM on the disk. This will load a NSC patch for ProDOS and then it loads the 2nd SYSTEM file it finds which should be A2OSX.SYSTEM.
- A2OSX.SYSTEM will then load and run all the KM.* files it finds in the ./SYS sub-directory. These are Kernel Modules that configure ProDOS before the main Kernel of A2osX loads. See the section on KMs for more information on what each module does.
- A2OSX.SYSTEM then installs a new QUIT CODE routine
- The new QUIT CODE routine loads and runs KERNEL found in ./SYS.
- QUIT CODE loads Kernel Parameters stored in ./A2OSX.KCONFIG if the file exists.
- KERNEL then executes the boot script stored in ./ETC/INIT
- KERNEL starts GETTY Process (./SBIN/GETTY) for each configured virtual terminal
- Each GETTY process starts a LOGIN process (./SBIN/LOGIN)
- When a user logs in LOGIN starts a shell process (./BIN/SH)
- This shell process executes the script PROFILE found in the users home directory.
- *PRODOS* is loaded
- The first SYSTEM program found on the volume is loaded. Typically if you have a no slot clock (NSC), you will have *NS.CLOCK.SYSTEM* on the disk. This will load a NSC patch for ProDOS and then it loads the 2nd SYSTEM file it finds which should be *A2OSX.SYSTEM*.
- *A2OSX.SYSTEM* will then load and run all the KM.* files it finds in the *./sys* sub-directory. These are Kernel Modules that configure ProDOS before the main Kernel of A2osX loads. See the section on KMs for more information on what each module does.
- *A2OSX.SYSTEM* then installs a new QUIT CODE routine
- The new QUIT CODE routine loads and runs KERNEL found in *./sys*.
- QUIT CODE loads Kernel Parameters stored in *./A2osX.kconfig* if the file exists.
- KERNEL then executes the boot script stored in *./etc/init*
- KERNEL starts GETTY Process (*./sbin/getty*) for each configured virtual terminal
- Each GETTY process starts a LOGIN process (*./sbin/login*)
- When a user logs in LOGIN starts a shell process (*./bin/sh*)
- This shell process executes the script *PROFILE* found in the users home directory.
Some notes on the above:
- A2osX has been tested on ProDOS versions 2.0.3 and 2.4.2. We welcome testing and feedback on using A2osX with other versions.
- The NS.CLOCK.SYSTEM is not needed by A2osX because there is a Kernel Module that accomplishes the same thing, please see the section on KMs. A user may want the NS.CLOCK.SYSTEM file if they are running other applications (i.e. AppleWorks) from the same volume so that the NSC patch gets enabled for their apps use of the clock.
- The *NS.CLOCK.SYSTEM* is not needed by A2osX because there is a Kernel Module that accomplishes the same thing, please see the section on KMs. A user may want the *NS.CLOCK.SYSTEM* file if they are running other applications (i.e. AppleWorks) from the same volume so that the NSC patch gets enabled for their apps use of the clock.
- There are enhancements planned for the QUIT CODE routine. In the future, we hope to allow you to execute another SYSTEM file from the Shell in A2osX whereby QC routine will unload A2osX, load your other SYSTEM program (again i.e. AppleWorks) and then when you quit that application, the QC routine will reload A2osX.
- When A2OSX.SYSTEM starts, it initializes the system in stages as described above (load KMs, load Kernel, execute INIT, etc.). If during this process you hold down the Open-Apple key, A2osX will stop at the end of each stage until you press another key. You can use this to debug startup problems/hardware conflicts.
- When *A2OSX.SYSTEM* starts, it initializes the system in stages as described above (load KMs, load Kernel, execute INIT, etc.). If during this process you hold down the Open-Apple key, A2osX will stop at the end of each stage until you press another key. You can use this to debug start up problems/hardware conflicts.
- When the KERNEL first starts, if the user presses Control-R a special maintenance mode is enabled. This is discussed in detail below.
- Currently the entire User/Group system is incomplete. As such we have temporarily set GETTY to automatically login each Terminal as user ROOT and execute the profile stored in ./ROOT. This may change prior to release.
- The ./ETC/INIT file can be used to automatically start the SSC.DRV and GETTY process for an external terminal. It can also be used to load network drivers and processes at boot.
- The ./${HOME}/PROFILE file can be used to change a users default $PATH, run a Shell Script or load a particular program when a user logs in.
- The *./etc/init* file can be used to automatically start the *ssc.drv* and **getty** process for an external terminal. It can also be used to load network drivers and processes at boot.
- The ./${HOME}/profile file can be used to change a users default $PATH, run a Shell Script or load a particular program when a user logs in.
If you decide to install/copy A2osX to your own existing Hard Drive or volume, you just need to be sure to keep the A2osX file system structure in tact. To start A2osX "manually" as it were, you change your PREFIX to the appropriate sub-directory and then load A2OSX.SYSTEM. So for example, if you had a CFFA card that booted to a volume called /HD1, you could make a subdirectory on this disk called A2OSX. You would then set your PREFIX to /HD1/A2OSX and launch A2OSX.SYSTEM and the rest of the boot process outlined above would be followed. Please see the section on Installation for more information on putting A2OSX on your own media.
If you decide to install/copy A2osX to your own existing Hard Drive or volume, you just need to be sure to keep the A2osX file system structure in tact. To start A2osX "manually" as it were, you change your PREFIX to the appropriate sub-directory and then load *A2OSX.SYSTEM*. So for example, if you had a CFFA card that booted to a volume called /HD1, you could make a subdirectory on this disk called A2OSX. You would then set your PREFIX to */HD1/A2OSX* and launch *A2OSX.SYSTEM* and the rest of the boot process outlined above would be followed. Please see the section on Installation for more information on putting A2OSX on your own media.
### A2osX Kernel Modules
@ -111,21 +110,18 @@ As stated above, when A2OSX first launches, it looks in the ./SYS subdirectory a
| Name | Comment |
| ------- | ------- |
| KM.APPLETALK | AppleTalk Support for ProDOS |
| KM.NSC | No-Slot-Clock/DS1216E |
| KM.RAMWORKS | AE-Ramworks I,II,III |
| KM.VSDRIVE | ADTPro Virtual Drive for SSC |
| *km.appletalk* | AppleTalk Support for ProDOS |
| *km.nsc* | No-Slot-Clock/DS1216E |
| *km.ramworks* | AE-Ramworks I,II,III |
| *km.vsdrive* | ADTPro Virtual Drive for SSC |
The KM.NSC module gives you the same functionality as the NS.CLOCK.SYSTEM routine found in the Boot volume of ProDOS. You do not need both files. If you are running NS.CLOCK.SYSTEM to support other applications, you can remove the KM.NSC module. Conversly, if you are only running A2osX off this booted volume, you can remove NS.CLOCK.SYSTEM and just use our KM since it is smaller in size (saving disk space).
The *km.nsc* module gives you the same functionality as the *NS.CLOCK.SYSTEM* routine found in the Boot volume of ProDOS. You do not need both files. If you are running *NS.CLOCK.SYSTEM* to support other applications, you can remove the KM.NSC module. Conversely, if you are only running A2osX off this booted volume, you can remove *NS.CLOCK.SYSTEM* and just use our KM since it is smaller in size (saving disk space).
The KM.RAMWORKS is needed only on systems with greater then 128K of memory provided by a RamWorks compatible 80-col card in an Apple //e. It turns any additional memory into a ram disk /RAM3. You should **NOT** load the KM.RAMWORKS module on Apple //GS systems.
The *km.ramworks* is needed only on systems with greater then 128K of memory provided by a RamWorks compatible 80-col card in an Apple //e. It turns any additional memory into a ram disk */RAM3*. You should **NOT** load the *km.ramworks* module on Apple //GS systems.
The KM.VSDRIVE module helps you connect to an ADTPRO server via a Super Serial Card (SSC). This module will use the first Super Serial Card in your system set with Interrupts off. It is also best if you set this SSC at a baud rate of 115200. If you have more then one SSC system and you are using the others for terminals you should fully understand how to configure the cards, Kernel Modules, and the SSC drivers for optimal performance.
The *km.vsdrive* module helps you connect to an ADTPRO server via a Super Serial Card (SSC). This module will use the first Super Serial Card in your system set with Interrupts off. It is also best if you set this SSC at a baud rate of 115200. If you have more then one SSC system and you are using the others for terminals you should fully understand how to configure the cards, Kernel Modules, and the SSC drivers for optimal performance.
- PK Note: Fill in actual details of confirmed Apple //e and GS setup for VSDRIVE with and without terminals as well.
The KM.APPLETALK module helps ProDOS talk to APPLETALK, though at the moment A2osX cannot use this facility until we complete the ATLOGIN/Mount programs. On most of our media you will find this KM stored in a subdirectory of ./SYS which means it is not loaded at start up.
The *km.appletalk* module helps ProDOS talk to APPLETALK, though at the moment A2osX cannot use this facility until we complete the ATLOGIN/Mount programs. On most of our media you will find this KM stored in a subdirectory of ./SYS which means it is not loaded at start up. As this module is in development, in may not be included on the media you download.
### A2osX Maintenance mode
@ -139,44 +135,44 @@ In maintenance mode, you still have access to all A2osX utilities and scripts, s
### A2osX Preemptive Mode
A2osX is a multiuser multitasking operating system. As with any such operating system running on a single core single CPU system such as an Apple II with the 6502, A2osX switches between all of the running processes automatically ensuring that each gets serviced in a reasonable time. It is the A2osX Kernel that performs this task in 1 of 2 manners: Cooperative or Preemptive mode. In Cooperative mode, the default, switching between processes occurs whenever an application makes a "blocking" API call (i.e. waiting for a key press or a network frame) or cooperatively relinquishes control (by explicitly calling >SLEEP, see the A2osX Developers Guide). In Preemptive Mode, set by option in the KCONFIG utility (see A2osX Command Guide), the kernel switches between "sleeping" processes automatically at 1/10th-second intervals. In order to use Preemptive Mode, your system must have supported hardware that generates an interrupt used by A2osX such as an Apple II Mouse or ThunderClock interface.
A2osX is a multi-user multitasking operating system. As with any such operating system running on a single core single CPU system such as an Apple II with the 6502, A2osX switches between all of the running processes automatically ensuring that each gets serviced in a reasonable time. It is the A2osX Kernel that performs this task in 1 of 2 manners: Cooperative or Preemptive mode. In Cooperative mode, the default, switching between processes occurs whenever an application makes a "blocking" API call (i.e. waiting for a key press or a network frame) or cooperatively relinquishes control (by explicitly calling >SLEEP, see the A2osX Developers Guide). In Preemptive Mode, set by option in the **kconfig** utility (see A2osX Command Guide), the kernel switches between "sleeping" processes automatically at 1/10th-second intervals. In order to use Preemptive Mode, your system must have supported hardware that generates an interrupt used by A2osX such as an Apple II Mouse or ThunderClock interface.
### A2osX Devices
A2osX supports a number of block or file devices for input and output (I/O). Devices should not be confused with hardware, though many devices correspond to actual hardware and not all hardware is presented as an A2osX device. For example, while A2osX supports getting the date and time from ProDOS, there is no "time" device; and while your Apple has a screen and keyboard, with A2osX a user interacts with a Terminal Device (i.e. /DEV/TTY1). This section discusses the devices with witch users or A2osX programs can interact. Please see the Hardware Section of this User guide for a fuller discussion of the hardware A2osX supports.
A2osX supports a number of block or file devices for input and output (I/O). Devices should not be confused with hardware, though many devices correspond to actual hardware and not all hardware is presented as an A2osX device. For example, while A2osX supports getting the date and time from ProDOS, there is no "time" device; and while your Apple has a screen and keyboard, with A2osX a user interacts with a Terminal Device (i.e. */dev/tty1*). This section discusses the devices with witch users or A2osX programs can interact. Please see the Hardware Section of this User guide for a fuller discussion of the hardware A2osX supports.
#### Null Device
There is a standard Null device that you can use in your scripts, typically to redirect error messages. This device is /DEV/NULL.
There is a standard Null device that you can use in your scripts, typically to redirect error messages. This device is */dev/null*.
#### Block Devices
A2osX supports all the ProDOS block devices including floppy drives, hard drives and Ram Disks. It has been tested to work with both 140K and 800K floppy drives, the FloppyEMU (both floppy types), the CFFA3000 and the ReActiveMicro Turbo as well as RAMWorks and Apple 1MB Memory cards. While these drives may be listed with the device identifier (i.e. S6D2 or S7D1) they are reference using their ProDOS names and pathing (i.e. /BOOT or /RAM3).
A2osX supports all the ProDOS block devices including floppy drives, hard drives and Ram Disks. It has been tested to work with both 140K and 800K floppy drives, the FloppyEMU (both floppy types), the CFFA3000 and the ReActiveMicro Turbo as well as RAMWorks and Apple 1MB Memory cards. While these drives may be listed with the device identifier (i.e. *s6d2* or *s7d1*) they are reference using their ProDOS names and pathing (i.e. */BOOT* or */RAM3*).
#### Virtual Terminals
A2osX supports multiple virtual terminals on your a single Apple system. By default the system is configured to support 2 virtual terminals (/DEV/TTY1 and /DEV/TTY2). This will be configurable in the future using the KCONFIG utility. In addition to these virtual terminals there is also a console device (/DEV/CONSOLE) and in the future a Double-High Graphics Resolution (/DEV/DHGR??) display. You can switch between these various devices by using the special Open-Apple key.
A2osX supports multiple virtual terminals on your a single Apple system. By default the system is configured to support 2 virtual terminals (*/dev/tty1* and */dev/tty2*). This will be configurable in the future using the **kconfig** utility. In addition to these virtual terminals there is also a console device (*/dev/console*) and in the future a Double-High Graphics Resolution (*/dev/dhgr??*) display. You can switch between these various devices by using the special Open-Apple key.
| Device | Open Apple Combo |
| --- | --- |
| Console | Open Apple 0 |
| TTY1 | Open Apple 1 |
| TTY2 | Open Apple 2 |
| TTY3 | Open Apple 3 |
| TTY4 | Open Apple 4 |
| DHGR | Open Apple 5 |
| *console* | Open Apple 0 |
| *tty1* | Open Apple 1 |
| *tty2* | Open Apple 2 |
| *tty3* | Open Apple 3 |
| *tty4* | Open Apple 4 |
| *dhgr* | Open Apple 5 |
Note: if only 2 virtual terminals are configured then OA-3 and OA-4 will have no effect. Once terminals are configurable in KCONFIG, please note that increasing and reducing the number of virtual terminals impacts the amount of memory used by A2osX.
Note: if only 2 virtual terminals are configured then OA-3 and OA-4 will have no effect. Once terminals are configurable in **kconfig**, please note that increasing and reducing the number of virtual terminals impacts the amount of memory used by A2osX.
#### Physical Terminals
A2osX supports physical terminals (or a PC running a terminal emulator) via a Super Serial Card and the A2osX SSC.DRV driver. You will need to set the switches on your SSC and the parameters of your terminal emulator to match and of course you will need the appropriate null modem cable. The terminal type supported is VT-100, so please set your emulator to VT-100 mode. A2osX does not support modems connected to your SSC at this time.
A2osX supports physical terminals (or a PC running a terminal emulator) via a Super Serial Card and the A2osX *ssc.drv* driver. You will need to set the switches on your SSC and the parameters of your terminal emulator to match and of course you will need the appropriate null modem cable. The terminal type supported is VT-100, so please set your emulator to VT-100 mode. A2osX does not support modems connected to your SSC at this time.
A2osX supports as many physical terminals as you have SSC cards and memory to load drivers for each card and support those users. Note that if you are running the KM.VSDRIVE module, it takes the first SSC card that is not configured for interrupts (likely slot 1 or 2). So if you INSDRV SSC.DRV with KM.VSDRIVE loaded, then it will use the next card. You have to load a driver for each card you want to handle as a terminal. You also have to start the GETTY process for each terminal. The Terminals will be named /DEV/COMx where x is the slot the card is in.
A2osX supports as many physical terminals as you have SSC cards and memory to load drivers for each card and support those users. Note that if you are running the *km.vsdrive* module, it takes the first SSC card that is not configured for interrupts (likely slot 1 or 2). So if you **insdrv ssc.drv** with *km.vsdrive* loaded, then it will use the next card. You have to load a driver for each card you want to handle as a terminal. You also have to start the **getty** process for each terminal. The Terminals will be named */dev/comx* where x is the slot the card is in.
#### Internet Terminals
A2osX supports multiple internet connected terminals via a TELNETD server process. The TELNETD process supports VT-100 terminals, so you should set your Telnet client (i.e. PuTTY) to use VT-100 emulation. Of course you can use another Apple running A2osX and the TELNET client to connect to an Apple running A2osX and the TELNETD server.
A2osX supports multiple internet connected terminals via a **telnetd** server process. The **telnetd** process supports VT-100 terminals, so you should set your Telnet client (i.e. PuTTY) to use VT-100 emulation. Of course you can use another Apple running A2osX and the **telnet** client to connect to an Apple running A2osX and the **telnetd** server.
Please note, if you are using Telnet Client Software such as PuTTY for Windows and see random garbled characters (odd graphics symbols), you may need to change your **Remote Character Set** to something other than **UTF-8**, such as **ISO-8859-1:1998 (Latin-1, West Europe)**.
@ -194,11 +190,11 @@ Minimum 140K 5.25 disk drive, 800K 3.5 strongly recommended.
Any ProDOS Block Device (5.25 & 3.5 Floppy Drives, SmartPort Hard Drive and Ram Disks)<br> NoSlot Clock or ThunderClock<br> Super Serial Card<br> Mouse Card<br> Network Card (Uthernet I or II, LanCEgs)
While A2osX supports a many Apple II hardware devices, it is possible a conflict will occur with a particular card in your unique hardware configuration. In these cases, the conflict usually arises when A2osX attempts to load a driver for a supported device it triggers a conflict with the ROM of an unsupported card when it searches your Apple II for the appropriate card. You can tell A2osX to not search the slots containing unsupported cards using the KCONFIG utility. In addition, a DEBUG boot disk is available in our Media collection that loads the absolute minimal parts of A2osX which can help in identifying and conflicting hardware.
While A2osX supports a many Apple II hardware devices, it is possible a conflict will occur with a particular card in your unique hardware configuration. In these cases, the conflict usually arises when A2osX attempts to load a driver for a supported device it triggers a conflict with the ROM of an unsupported card when it searches your Apple II for the appropriate card. You can tell A2osX to not search the slots containing unsupported cards using the **kconfig** utility. In addition, a DEBUG.po boot disk is available in our Media collection that loads the absolute minimal parts of A2osX which can help in identifying and conflicting hardware.
> A note on Accelerator Cards: A2osX has been tested and successfully runs on Apples with accelerator cards such as the Transwarp //e, Titan, or FastChip. Care must be taken, however, in making sure that the configuration of your card is correct for your system, especially while running A2osX. First you should ensure that the FAST/SLOW switches are set to slow as is appropriate for the cards installed in your system. Specifically you must set them to slow for Floppy Controllers, Network Controllers, Mouse Cards and Super Serial Cards. If you are unsure, set the switch to slow. In addition, with the FastChip, you may need to disable the RAMFACTOR and/or RAMWORKS emulation (further testing is underway).
> A note on Accelerator Cards: A2osX has been tested and successfully runs on Apples with accelerator cards such as the Transwarp //e, Titan, or FastChip. Care must be taken, however, in making sure that the configuration of your card is correct for your system, especially while running A2osX. First you should ensure that the FAST/SLOW switches are set to slow as is appropriate for the cards installed in your system. Specifically you must set them to slow for Floppy Controllers, Network Controllers, Mouse Cards and Super Serial Cards. If you are unsure, set the switch to slow. In addition, with the FastChip, you may need to disable the RAMFACTOR emulation (further testing is underway).
**INSERT SECTION HERE ON DEBUG.po and how to use it to solve HW conflict issues**
>**Need new section here on DEBUG.po and how to use it to solve hardware conflict issues**
## Getting Started
@ -230,13 +226,15 @@ You can then enter these commands to put A2osx on your Volume **/MYHD** (replac
/FULLBOOT/$ ECHO "-A2OSX.SYSTEM" >> /MYHD/AOSX
All of the commands above are documented in the A2osX Command Guide or the Shell Developers Guide, but briefly:
- MD creates a sub-directory on your volume named A2OSX
- CD .. moves up one directory level. The ROOT subdirectory is the home directory for the root user. We move up to the FULLBOOT volumes main directory so that the CP (copy) command issued next will copy all the files on this volume.
- CP copies files and in this case recursively (-R option) selecting all files (* wildcard) and puts them in the destination we created early /MYHD/A2OSX
- The next two lines create a bat file, or in ProDOS/BASIC terms an EXEC file that will first change the PREFIX to our new A2OSX subdirectory and then launch A2osX. Note the first line use > which will create a file and the 2nd uses >> which appends to a file. Also note that we named the file AOSX and not A2OSX as the laters name is already used by the sub-directory we created.
- **md** creates a sub-directory on your volume named A2OSX
- **cd** .. moves up one directory level. The ROOT subdirectory is the home directory for the root user. We move up to the FULLBOOT volumes main directory so that the **cp** (copy) command issued next will copy all the files on this volume.
- **cp** copies files and in this case recursively (**-r** option) selecting all files (* wildcard) and puts them in the destination we created early /MYHD/A2OSX
- The next two lines create a bat file, or in ProDOS/BASIC terms an EXEC file that will first change the PREFIX to our new A2OSX sub directory and then launch A2osX. Note the first line use > which will create a file and the 2nd uses >> which appends to a file. Also note that we named the file AOSX and not A2OSX as the latter's name is already used by the sub-directory we created.
### Configuring A2osX
There are several ways you can configure A2osX to suit your needs. Some of these
### Exploring A2osX
### Networking
@ -411,7 +409,7 @@ This range may be reused by multiple BINs so scripts checking these results shou
The A2osX Development thanks the many Apple II hobbyists out there who have contributed their time and resources testing and contributing to the success of A2osX. Your efforts make a positive difference in the quality and completeness of A2osX and are greatly appreciated. A special thanks to Dan Chisarick for providing an Apple //GS system to our team for testing and setting up an A2osX Telnet Server. We would also like to thank A2Heaven for their help and support of the A2osX team testing and documenting A2osX running on Fast Chip //e equipped Apples.
## License
A2osX is licensed under the GNU General Pulic License.
A2osX is licensed under the GNU General Public License.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,6 +1,6 @@
## License
A2osX is licensed under the GNU General Pulic License.
A2osX is licensed under the GNU General Public License.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -6,7 +6,7 @@ AUTO 4,1
# This script makes a proper fullboot 32mb disk using the files
# found in a particular BUILD stored in /make/builds
#
. MAKEFUNCS
. makefuncs
CALL CS
CALL TBOX " fullboot 32mb Media Creator"
CALL PRINTXY 8 0 "You must have the correct image mounted on S7D2"
@ -28,7 +28,7 @@ IF [ -Z $B ]
ECHO "Exiting"
EXIT
FI
SET SRC = "/make/builds/build${B}"
SET SRC = "/MAKE/BUILDS/BUILD${B}"
IF [ -D ${SRC} ]
ECHO "\n\nFound Valid BUILD\n"
ELSE
@ -66,7 +66,7 @@ SWITCH $RCS
EXIT
END
ECHO "Formatting Destination..."
FORMAT -B 65535 s7d2 fullboot
format -B 65535 s7d2 fullboot
ECHO "Making Directory Structure..."
md /fullboot/bin
md /fullboot/drv
@ -81,15 +81,15 @@ md /fullboot/var
md /fullboot/var/log
ECHO "Copying Files..."
FOR FILE IN (fullfiles)
CP -Q ${SRC}/${FILE} /fullboot/${FILE}
cp -Q ${SRC}/${FILE} /fullboot/${FILE}
NEXT
CP -Q -Y ${SRC}/prodos /fullboot/ProDOS
CP -Q -Y initboot /fullboot/etc/init
cp -Q -Y ${SRC}/PRODOS.FX /fullboot/ProDOS
cp -Q -Y initboot /fullboot/etc/init
ECHO "Welcome to A2osX!" > /fullboot/etc/issue
ECHO >> /fullboot/etc/issue
ECHO $IM >> /fullboot/etc/issue
CP -Q tcpip.conf /fullboot/etc/tcpip.conf
CP -Q profile /fullboot/root/profile
cp -Q tcpip.conf /fullboot/etc/tcpip.conf
cp -Q profile /fullboot/root/profile
ECHO "fullboot 32mb Disk Created!"
MAN
TEXT /MAKE/USR/SHARE/MAKE/MAKEFULL32

View File

@ -6,7 +6,7 @@ AUTO 4,1
# This script makes a proper tdboot disk using the files
# found in a particular BUILD stored in /make/builds
#
. MAKEFUNCS
. makefuncs
CALL CS
CALL TBOX " tdboot Media Creator"
CALL PRINTXY 8 0 "You must have the correct image mounted on S7D2"
@ -28,7 +28,7 @@ IF [ -Z $B ]
ECHO "Exiting"
EXIT
FI
SET SRC = "/make/builds/build${B}"
SET SRC = "/MAKE/BUILDS/BUILD${B}"
IF [ -D ${SRC} ]
ECHO "\n\nFound Valid BUILD\n"
ELSE
@ -66,7 +66,7 @@ SWITCH $RCS
EXIT
END
ECHO "Formatting Destination..."
FORMAT -B 65535 s7d2 tdboot
format -B 65535 s7d2 tdboot
ECHO "Making Directory Structure..."
md /tdboot/bin
md /tdboot/drv
@ -81,15 +81,15 @@ md /tdboot/var
md /tdboot/var/log
ECHO "Copying Files..."
FOR FILE IN (fullfiles)
CP -Q ${SRC}/${FILE} /tdboot/${FILE}
cp -Q ${SRC}/${FILE} /tdboot/${FILE}
NEXT
CP -Q -Y ${SRC}/prodos /tdboot/ProDOS
CP -Q -Y tdbootinit /tdboot/etc/init
cp -Q -Y ${SRC}/PRODOS.FX /tdboot/ProDOS
cp -Q -Y tdbootinit /tdboot/etc/init
ECHO "Welcome to A2osX!" > /tdboot/etc/issue
ECHO >> /tdboot/etc/issue
ECHO $IM >> /tdboot/etc/issue
CP -Q tcpip.conf /tdboot/etc/tcpip.conf
CP -Q profile /tdboot/root/profile
cp -Q tcpip.conf /tdboot/etc/tcpip.conf
cp -Q profile /tdboot/root/profile
ECHO "tdboot Disk Created!"
MAN
TEXT /MAKE/USR/SHARE/MAKE/MAKETD

View File

@ -18,7 +18,7 @@ ELSE
SET F = 0
SET P = 0
FI
SET LIST = "0 22 44 -55 14.7 1234.4321"
SET LIST = "0 22 44 -55 14 1234"
SET COUNT = 0
SET TOTAL = 0
FOR ITEM IN $LIST