diff --git a/.Docs/Command Guide.md b/.Docs/Command Guide.md index 490336de..06ae73f8 100644 --- a/.Docs/Command Guide.md +++ b/.Docs/Command Guide.md @@ -1,6 +1,6 @@ # A2osX Command Guide -### Updated October 20, 2019 +### Updated November 14, 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. @@ -249,6 +249,8 @@ It looks like the same results, but from now instead of LS simply outputting all | EDIT [filename] | 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. ![](../.screen-shots/ScreenShot.EDIT.png) diff --git a/.Docs/Shell Developers Guide.md b/.Docs/Shell Developers Guide.md index 42866664..17ef0ab6 100644 --- a/.Docs/Shell Developers Guide.md +++ b/.Docs/Shell Developers Guide.md @@ -1,29 +1,29 @@ # A2osX Shell Developers Guide -### Updated October 31, 2019 +### Updated November 19, 2019 -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), PWD, DATE, 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 (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 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 +It should be noted, that 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). An example ``` 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* wild card and perform the CAT operation on each. The semicolons act as a line separator allowing you to type in multiple commands, or short scripts on a single line, to execute as a script. +In this example, the system will generate a list of files found in the current directory which match the CT* wild card and perform the CAT operation on each. The semicolons act as line separators allowing you to type in multiple commands, or short scripts on a single line. -This Developers Guide will cover the basic operation of the interactive shell, the available commands as well as creating and using complex scripts that can be run by the shell. +This Developers Guide will cover the basic operation of the interactive shell, the internal shell commands and creating complex scripts that can be run by the shell. For information on external commands consult the **[A2osX Command Guide](.Docs/Command%20Guide.md)**. ## The A2osX Shell (SH) -The default A2osX Shell, ./BIN/SH, is an A2osX 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), and is the primary tool for interacting with the A2osX system. The SH shell is based somewhat on the Linux BASH shell, to the extend 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 A2osX 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), and is the primary tool for interacting with the A2osX system. The SH shell is based losely 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 SH shell 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, so the information below on writing scripts applies to the PROFILE file. +As the primary mechanism for working with A2osX, the SH shell 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, so the information below on writing scripts applies to the PROFILE script file. ### Interacting with the Shell -To interact with the A2osX shell, you type commands at the presented 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 **$** you can enter any of the valid internal shell commands or an external program name. For external programs, A2osX will search in the current directory and then in the directories specified in the **$PATH** variable. +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 **$** 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 current directory and then in the directories specified in the **$PATH** variable. #### Special Keys @@ -48,34 +48,293 @@ In addition to the editing keys above, you can use the following special keys wh | Open Apple-0 | Switches you to the console display | | Open Apple-1 to 4 | Switches you to Virtual Terminals 1 through 4 if so configured | -#### Internal Commands +### Internal Commands -The A2osX Shell contains an advanced set of internal commands. Several of these commands are commonly used interactively (at the $ prompt) while others are most useful in scripts. Technically all of these commands can be used both interactively or in scripts, many really show their power in scripts you develop or run. +The A2osX Shell contains an advanced set of internal commands. Several of these commands are commonly used interactively (at the $ prompt) while others are most useful in scripts. Technically all of these commands can be used both interactively or in scripts, though many really only show their power in scripts you develop or run. -Whether in scripts or typed in at the interactive Shell prompt ($), most commands support, or even require, one or more *\* and/or *\*. Commands typically use *\* as their *\* and *\* as their *\*, however in some cases you may use *\* or **. A full command line may be in the form of

**command \ \ \ argument argument** or -**command \[ <\expression\> \]** +Whether in scripts or typed in at the interactive Shell prompt ($), most commands support, or even require, one or more *\* and/or *\*. Commands typically use *\* as their *\* and *\* as their *\*, however in some cases you may use *\* or **. A full command line may be in the form of -where in the first nomenclature a **command** performs an action with or on the objects passed as *\*, modifying its behavior (the action it performs) based on *\* 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 an *\* is evaluated and the result is processed by the command to effect program flow. + **command \ \ \ argument argument** or + **command \[ <\condition\> \]** -> A note on command line structure for internal and external commands: When passing a command a series of arguments, you must a space include 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. -> +where in the first nomenclature a **command** performs an action with or on the objects passed as *\*, modifying its behavior (the action it performs) based on *\* 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 *\* is evaluated and the result is processed by the command to effect program flow. -CD -DATE -ECHO -EXIT -MD -NOHUP -POPD -PUSHD -PWD -RD -REN -SET -SLEEP -TIME +> 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. -###### READ +#### 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. + +##### \ + +The shell features a lot of built-in checks and comparisons called \ throughout this guide. This particular form of an argument is used exclusively by the **IF** and **WHILE** commands where the \ is evaluated and result is used to control program flow with in the defined **IF-ELSE-FI** or **WHILE-LOOP** block. 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 you 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 + +> Is the same as + + IF [ condition ] + ECHO result + ELSE + ECHO message + FI + +> The single line notation allows these sample scripts to be significantly shorter; there 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. + +This script demonstrates the usage of the various "Check" Conditions. + + #!/BIN/SH + # + # IF [ -CHECK arg ] Examples + # + # Echo "Found" if their is a subdirectory TEST is 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 + # 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 variable ABC contains 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 + SET ABC = 123.456 ; IF [ -I $ABC ] ; 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 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 + +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 String ] 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 + +> 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). + + #!/BIN/SH + # + # IF [ Int32 Int32 ] 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 + +> 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 \ 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 + +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 + +You can further extend \ by building complex evaluations that consist of multiple check or comparison \ joined by AND and/or OR. The following are examples using AND and OR. + + #!/BIN/SH + # + # IF 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) + +When using multiple of these joiners with a single command such as **IF**, care should be made in the structuring of your \ 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 \, 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 \ 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)**. + +##### \ + +The A2osX shell contains a simple 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 + +##### \ + +\ are operators, the simple integer math functions that can be performed in the shell. They are a special argument used only in \, see above. The valid \ are \+ \- \* \/ and MOD. + +##### \ + +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. + +##### \ + +Values are the simplest of arguments, usually a string or an integer, which may be presented in the form of a variable. Technically the format of the ECHO command is **ECHO [-N] [\ ...]**. This means that the ECHO command can be followed by the optional switch -N and one or more optional \. In the case of ECHO, it is these \ that are output by the command. In this case, 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. A word about values, command lines and spaces: **ECHO Hello World** is not the same as **ECHO "Hello World"**. In the first case you 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        World"** would be output as **Hello World** as ECHO would treat each Hello and World as values and output value space value. + +#### AND + +The **AND** reserved word is used to join 2 or more conditions together to create complex logic statements. See \ section above for more information on **AND** and examples of its usage. In addition, look at **[ANDORTESTS](EXAMPLES/ANDORTESTS.txt)**, a complete script using **AND**. + +#### BREAK + +The **BREAK** command is used to exit a particular **CASE** that is part of a **SWITCH** script block. See the **CASE** command below for more information and example of using **BREAK**. + +#### CALL + +| CALL | Working | CALL function \ ... | + +#### CASE + +| CASE | Working | CASE | + +#### CD + +| CD | Working | CD path or relative path | + +#### DATE + +| DATE | Working | %a : Abbreviated weekday name : Thu
%A : Full weekday name : Thursday
%b : Abbreviated month name : Aug
%B : Full month name : August
%d : Day of the month, zero-padded (01-31)
%H : Hour in 24h format (00-23) 14
%I : Hour in 12h format (01-12) 02
%m : Month as a decimal number (01-12) 08
%M : Minute (00-59) 55
%p : AM or PM designation PM
%S : Second (00-61) 02
%w : Weekday as a decimal number with Sunday as 0 (0-6)
%y : Year, last two digits (00-99)
%Y : Year four digits 2001 | + +#### DEFAULT + +| DEFAULT | Working | Default CASE for SWITCH | + +#### ECHO + +| ECHO | Working | \b,\e,\f,\n,\\\ and \\% supported
-N : Suppress \r\n | + +#### ELSE + +| ELSE | Working | Optional branch for IF block | + +#### END + +| END | Working | End of SWITCH Statement | + +#### EXIT + +| EXIT | Working | exit function, script or shell | + +#### FI + +| FI | Working | Terminator for IF block | + +#### FUNCTION + +| FUNCTION | Working | FUNCTION function_name {
\
} | + +if you SET -F, it will discard ALL previously learnt FUNC in the current SH context +if . FUNCS1 file add 3 +then . FUNCS2 file add 2 +all 5 are available until an set -X is met +if you launch . MYFILE1, the code within MYFILE1 can CALL all 5 functions +but MYFILE1 (wthout dot) will run in a separate SH process, so no access to the 5 functions known by parent SH +functions bodies are stored in AUX ram +so you can put around 30k of code in AUX ram then do a short MYFILE1 that calls a lot of FUNC +in AUX +FUNCs recursion is allowed (until you explode the stack!) + +CORE.STACK.MAX = 128....so each CALL consumes about 7 bytes of stack (return Ctx/Ptr, ArgVC,hArgV and CALL keywordID) + + +#### IF + +| IF | Working | [ \ ]
![ \ ]| + +#### LOOP + +| LOOP | Working | Terminator for WHILE block | + +#### MD + +| MD | Working | MD path or relative path
Create a directory | + +#### NOHUP + +| NOHUP | Working | Start a process with PPID=PS0 (Daemon) | + + +#### OR + +The **OR** reserved word is used to join 2 or more conditions together to create complex logic statements. See \ section above for more information on **OR** and examples of its usage. In addition, look at **[ANDORTESTS](EXAMPLES/ANDORTESTS.txt)**, a complete script using **OR**. + +#### PAUSE + +| PAUSE | Working | Wait until CR | + +#### POPD + +| POPD | Working | Restore previously saved working directory | + +#### PUSHD + +| PUSHD | Working | Save actual working directory
PUSHD \ do also a CD to \ | + +#### PWD + +| PWD | Working | Print Working Directory | + +#### RD + +| RD | Working | Delete an empty directory | + +#### READ + +| READ | Working | -S : no echo (password)
-P : "prompt message"
-N maxchar | The READ command allows you to accept input from the user which can be used or evaluated in other commands. For instance you can use the READ command to get the name of a file to copy, ask the user for confirmation (Proceed?) and evaluate their response with an IF command, etc. READ has several powerful options including: Prompt, Suppress and NumChars. In all cases you must specify a variable in which to place the results of the READ command. @@ -102,8 +361,9 @@ The READ command allows you to accept input from the user which can be used or e # This can be used to capture/process special keys like TAB, Arrows and DEL. READ -N 0 A +#### REN -###### REN +| REN | Working | Rename a file, directory or volume | The REN command allows you to Rename a single file, directory or Volume. It does not support wild cards. While REN and MV may seem similar, they are very different commands and you should use each for its intended purpose. In the case of REN, it changes the name of an item (Vol, Dir, File) in place; the item itself is not changed. For those familiar with ProDOS file systems, REN changes the entry of an item in the CATALOG. MV on the other hand actually copies files (and removes the original) to move them. Obviously REN is more efficient at RENaming an item in its current location, whereas MV could be used to change the location of a file (MV it from one directory or even volume to another). Yes you can use MV MYFILE NEWFILE to do the same thing as REN MYFILE NEWFILE, but since a copy must occur, it will be slower and you will have to have sufficient disk space free to make this copy. @@ -131,8 +391,40 @@ The REN command allows you to Rename a single file, directory or Volume. It doe # REName a file using a full path REN /FULLBOOT/TMP/MYFILE NEWFILENAME -#### Redirection +#### SET +| SET | Working | -X : toggle debug mode
-C : toggle Control-C break mode
-E : toggle error printing mode
-F : delete all declared functions | + +#### SHIFT + +| SHIFT | Working | Remove $1 from cmd line | + +#### SLEEP + +| SLEEP | Working | Wait \ 10th sec | + +#### SWITCH + +| SWITCH | Working | SWITCH | + +#### WHILE + +| WHILE | Working | [ \ ] | + +### Redirection + +| Token | Status | Comment | +| ---- | ------ | ------- | +| . | Working | use same env | +| & | Working | start proc | +| \| | Working | pipe | +| < | Working | StdIn redirection | +| > | Working | StdOut redirection | +| >> | Working | Append StdOut | +| 1>> | Working | | +| 1> | Working | | +| 2>> | Working | StdErr redirection | +| 2> | Working | | ### Writing Scripts @@ -140,8 +432,6 @@ Calling other scripts calling scripts with . (dot space) before script name from within a script loading functions this way - - #### Variables Variable overflow strings and ints @@ -154,14 +444,29 @@ Strings can be up to 255 characters in length. Note, like INTs, if you try to s ##### Special Variables $BOOT -$ROOT -$PATH -$TERM -$PS1 $DRV $LIB +$PATH +$PS1 +$ROOT +$TERM -## Advanced Display Techniques +| Name | Status | Comment | +| ---- | ------ | ------- | +| $0 | Working | Command Full Path | +| $1-$9 | Working | Arg[n] | +| $* | Working | All Args | +| $# | Working | Arg Count | +| $? | Working | Return Code | +| $@ | Working | Parent PID | +| $$ | Working | PID | +| $! | Working | Child PID | +| $UID | Working | PS Owner UID | +| $PWD | Working | Working Directory | + +note : '$VAR' does NOT expand Variable + +### 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).** @@ -214,7 +519,6 @@ A2osX provides advanced screen handling capabilities for the Apple console (keyb # Clear line 15 ECHO \e[15;01H\e[2K - ###Examples IFTTT Tweet using HTTPGET @@ -254,100 +558,6 @@ is the same as Notice that the DO X and DO Y logic is swapped between the two cases. -## Internal Shell commands: - -| Name | Status | Comment | -| ---- | ------ | ------- | -| \ | Working | $VAR \| string \| "string with SPACE" \| 123 \| -456 | -| \ | Working | \ [\ \] ... | -| \ | Working | \+ signed int32 add
\- signed int32 sub
\*
/
mod | -| \ | Working |[ -D direxists ]
[ -E fileordirexists ]
[ -F fileexists ]
[ -N $VAR variable is not empty ]
[ -Z $VAR variable is empty ]
[ string1 = string2 ]
[ string1 != string2 ]
[ string1 .< string2 ]
[ string1 <= string2 ]
[ string1 .> string2 ]
[ string1 >= string2 ]
[ int32 -eq int32 ]
[ int32 -ne int32 ]
[ int32 -lt int32 ]
[ int32 -le int32 ]
[ int32 -gt int32 ]
[ int32 -ge int32 ]| -| BREAK | Working | Exit CASE of SWITCH | -| CALL | Working | CALL function ... | -| CASE | Working | CASE | -| CD | Working | CD path or relative path | -| .. | Working | CD .. | -| DATE | Working | %a : Abbreviated weekday name : Thu
%A : Full weekday name : Thursday
%b : Abbreviated month name : Aug
%B : Full month name : August
%d : Day of the month, zero-padded (01-31)
%H : Hour in 24h format (00-23) 14
%I : Hour in 12h format (01-12) 02
%m : Month as a decimal number (01-12) 08
%M : Minute (00-59) 55
%p : AM or PM designation PM
%S : Second (00-61) 02
%w : Weekday as a decimal number with Sunday as 0 (0-6)
%y : Year, last two digits (00-99)
%Y : Year four digits 2001 | -| DEFAULT | Working | Default CASE for SWITCH | -| ECHO | Working | \b,\e,\f,\n,\\\ and \\% supported
-N : Suppress \r\n | -| ELSE | Working | Optional branch for IF block | -| END | Working | End of SWITCH Statement | -| EXIT | Working | exit function, script or shell | -| FI | Working | Terminator for IF block | -| FUNCTION | Working | FUNCTION function_name {
\
} | -| IF | Working | [ \ ]
![ \ ]| -| LOOP | Working | Terminator for WHILE block | -| MD | Working | MD path or relative path
Create a directory | -| NOHUP | Working | Start a process with PPID=PS0 (Daemon) | -| PAUSE | Working | Wait until CR | -| POPD | Working | Restore previously saved working directory | -| PUSHD | Working | Save actual working directory
PUSHD \ do also a CD to \ | -| PWD | Working | Print Working Directory | -| RD | Working | Delete an empty directory | -| READ | Working | -S : no echo (password)
-P : "prompt message"
-N maxchar | -| REN | Working | Rename a file, directory or volume | -| SET | Working | -X : toggle debug mode
-C : toggle Control-C break mode
-E : toggle error printing mode
-F : delete all declared functions | -| SHIFT | Working | Remove $1 from cmd line | -| SLEEP | Working | Wait \ 10th sec | -| SWITCH | Working | SWITCH | -| WHILE | Working | [ \ ] | - -## Shell variables: - -| Name | Status | Comment | -| ---- | ------ | ------- | -| $0 | Working | Command Full Path | -| $1-$9 | Working | Arg[n] | -| $* | Working | All Args | -| $# | Working | Arg Count | -| $? | Working | Return Code | -| $@ | Working | Parent PID | -| $$ | Working | PID | -| $! | Working | Child PID | -| $UID | Working | PS Owner UID | -| $PWD | Working | Working Directory | - -note : '$VAR' does NOT expand Variable - -## Shell I/O control/redirection: - -| Token | Status | Comment | -| ---- | ------ | ------- | -| . | Working | use same env | -| & | Working | start proc | -| \| | Working | pipe | -| < | Working | StdIn redirection | -| > | Working | StdOut redirection | -| >> | Working | Append StdOut | -| 1>> | Working | | -| 1> | Working | | -| 2>> | Working | StdErr redirection | -| 2> | Working | | - - -## Stuff to work on - -if [] && [] is AND -if [] || [] is OR - - -### functions - -if you SET -F, it will discard ALL previously learnt FUNC in the current SH context -if . FUNCS1 file add 3 -then . FUNCS2 file add 2 -all 5 are available until an set -X is met -if you launch . MYFILE1, the code within MYFILE1 can CALL all 5 functions -but MYFILE1 (wthout dot) will run in a separate SH process, so no access to the 5 functions known by parent SH -functions bodies are stored in AUX ram -so you can put around 30k of code in AUX ram then do a short MYFILE1 that calls a lot of FUNC -in AUX -FUNCs recursion is allowed (until you explode the stack!) - -CORE.STACK.MAX = 128....so each CALL consumes about 7 bytes of stack (return Ctx/Ptr, ArgVC,hArgV and CALL keywordID) - -* DIV/MOD - ## License A2osX is licensed under the GNU General Pulic License. diff --git a/.Docs/Technical Spec.md b/.Docs/Technical Spec.md index 0aabb628..01433308 100644 --- a/.Docs/Technical Spec.md +++ b/.Docs/Technical Spec.md @@ -1,6 +1,6 @@ # A2osX (0.93) Multi-Tasking OS for Apple II -### Updated October 20, 2019 +### Updated November 19, 2019 This is the functional specification for A2osX and its system modules, internal and external commands and shell language. Please refer to the other A2osX documentation such as the User Guide, Notes for Developers and Shell Programming Guide for more information on the use of these commands and modules. @@ -46,12 +46,13 @@ This is the functional specification for A2osX and its system modules, internal | ARP | Working | dump ARP cache, setup a static ARP entry | 0.93 | | ASM | In Progress | S-C MASM based multi CPU assembler | 0.94 | | CAT | Working | -A : Show All non printable caracters
-N : Number all output lines
-S : Suppress repeated empty output lines | 0.93 | -| CUT | Working | CUT \ "line" or CMD \| CUT \
-F nn : Output field nn
-M nn : Output starting at nn
-N nn : Output Ending at nn
-S ch : Change default SPACE separator to 'ch' | 0.93 | | CHGRP | Future | -C : Continue On Error
-R : Recurse subdirectories | | | CHMOD | Future | -C : Continue On Error
-R : Recurse subdirectories | | | CHOWN | Future | -C : Continue On Error
-R : Recurse subdirectories | | | CHTYP | Working | -C : Continue On Error
-R : Recurse subdirectories | 0.93 | +| CMP | Working | CMP File1 File2 [SKIP1 [SKIP2]]
-A : Shows All differences
-V : Verbose Mode | 0.93 | | CP | Working | -C : Continue On Error
-Q : Quiet
-R : Recurse subdirectories
-Y : Dont't Prompt For Override | 0.93 | +| CUT | Working | CUT \ "line" or CMD \| CUT \
-F nn : Output field nn
-M nn : Output starting at nn
-N nn : Output Ending at nn
-S ch : Change default SPACE separator to 'ch' | 0.93 | | DNSINFO | Working | dump DNS cache, setup a static DNS entry | 0.93 | | EDIT | Working | still missing : find/replace | 0.93 | | FORMAT | In Progress | FORMAT \ [VOLUME.NAME]
-B Blocks : Force number of blocks to format
-L : Low-Level Format *not currently supported
-1..9 : Catalog Size (block count) | 0.93 | @@ -67,28 +68,40 @@ This is the functional specification for A2osX and its system modules, internal | MEMDUMP | Working | Tool to track memory leak| 0.93 | | MKDIR | Working | Make Directory| 0.93 | | MORE | Working | MORE \ or CMD\|MORE \
-N : Number all output lines
-P : Page mode, no scroll
-S : Process ESC codes | 0.93 | +| MV | Working | -C : Continue On Error
-Q : Quiet
-R : Recurse subdirectories
-Y : Dont't Prompt For Override | 0.93 | | NETSTAT | Working | Display socket status | 0.93 | | NSCUTIL | Working | NSCUTIL DD/MM/YY,hh:mm:ss
Tool for setting time in NSC/DL1216E | 0.93 | -| MV | Working | -C : Continue On Error
-Q : Quiet
-R : Recurse subdirectories
-Y : Dont't Prompt For Override | 0.93 | +| PAK | Working| PAK Archive [File/Dir, *,? wildcards allowed\]
-A: Append to Archive
-R: Recurse subdirectories | 0.93 | | PING | Working | PING
-1..9 : Ping Count | 0.93 | | PS | Working | List Processes| 0.93 | | RM | Working | RM \[File/Dir, *,? wildcards allowed\]
-C : Continue On Error
-Q : Quiet
-R : Recurse subdirectories | 0.93 | +| RPCDUMP | In Progress | Tool based on UDP socket API, renamed from RPCINFO
RPCDUMP | 0.93 | | SH | Working | Shell Command Processor
(See Internal Shell commands) | 0.93 | | TELNET | Working | TELNET [port] | 0.93 | -| RPCDUMP | In Progress | Tool based on UDP socket API, renamed from RPCINFO
RPCDUMP | 0.93 | +| TERM | Testing | TERM \ | 0.93 | +| UNPAK | Testing | UNPAK archive | 0.93 | +| USERADD | Testing | USERADD username
-c Comment : GECOS comment
-d HD : Home Directory
-p PW : Password
-s SH : Shell | 0.93 | +| USERDEL | Testing | USERDEL username
-r : Force removes files in home directory | 0.93 | +| WC | Testing | WC File(s) (*,? wildcards allowed)
-C: Continue on error
-R: Recurse Subdirectories
-M: Print CHAR counts
-L: Print LINE counts
-W: Print WORD counts | 0.93 | +| WHO | Testing | List Users Online | 0.93 | ## Internal Shell commands: | Name | Status | Comment | | ---- | ------ | ------- | -| \ | Working | $VAR \| string \| "string with SPACE" \| 123 \| -456 | +| \ | Working |[ -D direxists ]
[ -E fileordirexists ]
[ -F fileexists ]
[ -I $VAR variable is an integer ]
[ -N $VAR variable is not empty ]
[ -Z $VAR variable is empty ]
[ string1 = string2 ]
[ string1 != string2 ]
[ string1 .< string2 ]
[ string1 <= string2 ]
[ string1 .> string2 ]
[ string1 >= string2 ]
[ int32 -eq int32 ]
[ int32 -ne int32 ]
[ int32 -lt int32 ]
[ int32 -le int32 ]
[ int32 -gt int32 ]
[ int32 -ge int32 ] | | \ | Working | \ [\ \] ... | | \ | Working | \+ : signed int32 add
\- : signed int32 subtract
\* : signed int32 multiply
/ : signed int32 divide
mod : signed int32 modulo | -| \ | Working |[ -D direxists ]
[ -E fileordirexists ]
[ -F fileexists ]
[ -N $VAR variable is not empty ]
[ -Z $VAR variable is empty ]
[ string1 = string2 ]
[ string1 != string2 ]
[ string1 .< string2 ]
[ string1 <= string2 ]
[ string1 .> string2 ]
[ string1 >= string2 ]
[ int32 -eq int32 ]
[ int32 -ne int32 ]
[ int32 -lt int32 ]
[ int32 -le int32 ]
[ int32 -gt int32 ]
[ int32 -ge int32 ] | +| \ | Working | $VAR \| string \| "string with SPACE" \| 123 \| -456 | +| ! | Working | ![ \ ] : Negate condition | +| ( ) | Working | Parens used define list as FOR argument | +| { } | Working | Braces used to define FUNCTION body | +| AND | Working | Add mandatory condition | | BREAK | Working | Exit CASE of SWITCH | +| CALL | Working | CALL function \ ... | | CASE | Working | CASE | | CD | Working | CD path or relative path | -| DATE | Working | | +| DATE | Working | %a : Abbreviated weekday name : Thu
%A : Full weekday name : Thursday
%b : Abbreviated month name : Aug
%B : Full month name : August
%d : Day of the month, zero-padded (01-31)
%H : Hour in 24h format (00-23) 14
%I : Hour in 12h format (01-12) 02
%m : Month as a decimal number (01-12) 08
%M : Minute (00-59) 55
%p : AM or PM designation PM
%S : Second (00-61) 02
%w : Weekday as a decimal number with Sunday as 0 (0-6)
%y : Year, last two digits (00-99)
%Y : Year four digits 2001 | | DEFAULT | Working | Default CASE for SWITCH | | ECHO | Working | \b,\e,\f,\n,\\\ and \\% supported
-N : Suppress \r\n | | ELSE | Working | Optional branch for IF block | @@ -100,6 +113,7 @@ This is the functional specification for A2osX and its system modules, internal | LOOP | Working | Terminator for WHILE block | | MD | Working | MD path or relative path
Create a directory | | NOHUP | Working | Start a process with PPID=PS0 (Daemon) | +| OR | Working | Add optional condition | | PAUSE | Working | Wait until CR | | POPD | Working | Restore previously saved working directory | | PUSHD | Working | Save actual working directory
PUSHD \ do also a CD to \ | @@ -111,7 +125,6 @@ This is the functional specification for A2osX and its system modules, internal | SHIFT | Working | Remove $1 from cmd line | | SLEEP | Working | Wait \ 10th sec | | SWITCH | Working | SWITCH | -| TIME | Working | | | WHILE | Working | [ \ ] | ## Shell variables: diff --git a/.Docs/User Guide.md b/.Docs/User Guide.md index a8218df5..32bbad29 100644 --- a/.Docs/User Guide.md +++ b/.Docs/User Guide.md @@ -1,6 +1,6 @@ # A2osX User Guide -### Updated October 24, 2019 +### Updated November 14, 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. @@ -118,7 +118,7 @@ As stated above, when A2OSX first launches, it looks in the ./SYS subdirectory a 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.RAMWORKS is needed only on systems with greater then 128K of memory. It turns any additional memory into a ram disk /RAM3. +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. diff --git a/.Floppies/A2OSX.MAKE.po b/.Floppies/A2OSX.MAKE.po index 08311da6..38edacba 100644 Binary files a/.Floppies/A2OSX.MAKE.po and b/.Floppies/A2OSX.MAKE.po differ diff --git a/EXAMPLES/ANDORTESTS.txt b/EXAMPLES/ANDORTESTS.txt new file mode 100644 index 00000000..4c34aa44 --- /dev/null +++ b/EXAMPLES/ANDORTESTS.txt @@ -0,0 +1,109 @@ +NEW + PREFIX +AUTO 4,1 +#!/BIN/SH +# +# Complex AND OR Tests +# +SET A = 1 +SET B = 2 +SET C = 3 +SET D = 4 +ECHO -N "TRUE AND TRUE OR TRUE AND TRUE ---> " +IF [ $A -eq 1 ] AND [ $B -eq 2 ] OR [ $C -eq 3 ] AND [ $D -eq 4 ] + ECHO TRUE +ELSE + ECHO FALSE +FI +ECHO -N "TRUE AND TRUE OR TRUE AND FALSE ---> " +IF [ $A -eq 1 ] AND [ $B -eq 2 ] OR [ $C -eq 3 ] AND [ $D -ne 4 ] + ECHO TRUE +ELSE + ECHO FALSE +FI +ECHO -N "TRUE AND TRUE OR FALSE AND TRUE ---> " +IF [ $A -eq 1 ] AND [ $B -eq 2 ] OR [ $C -ne 3 ] AND [ $D -eq 4 ] + ECHO TRUE +ELSE + ECHO FALSE +FI +ECHO -N "TRUE AND TRUE OR FALSE AND FALSE ---> " +IF [ $A -eq 1 ] AND [ $B -eq 2 ] OR [ $C -ne 3 ] AND [ $D -ne 4 ] + ECHO TRUE +ELSE + ECHO FALSE +FI +ECHO -N "TRUE AND FALSE OR TRUE AND TRUE ---> " +IF [ $A -eq 1 ] AND [ $B -ne 2 ] OR [ $C -eq 3 ] AND [ $D -eq 4 ] + ECHO TRUE +ELSE + ECHO FALSE +FI +ECHO -N "TRUE AND FALSE OR TRUE AND FALSE ---> " +IF [ $A -eq 1 ] AND [ $B -ne 2 ] OR [ $C -eq 3 ] AND [ $D -ne 4 ] + ECHO TRUE +ELSE + ECHO FALSE +FI +ECHO -N "TRUE AND FALSE OR FALSE AND TRUE ---> " +IF [ $A -eq 1 ] AND [ $B -ne 2 ] OR [ $C -ne 3 ] AND [ $D -eq 4 ] + ECHO TRUE +ELSE + ECHO FALSE +FI +ECHO -N "TRUE AND FALSE OR FALSE AND FALSE ---> " +IF [ $A -eq 1 ] AND [ $B -ne 2 ] OR [ $C -ne 3 ] AND [ $D -ne 4 ] + ECHO TRUE +ELSE + ECHO FALSE +FI +ECHO -N "FALSE AND TRUE OR TRUE AND TRUE ---> " +IF [ $A -ne 1 ] AND [ $B -eq 2 ] OR [ $C -eq 3 ] AND [ $D -eq 4 ] + ECHO TRUE +ELSE + ECHO FALSE +FI +ECHO -N "FALSE AND TRUE OR TRUE AND FALSE ---> " +IF [ $A -ne 1 ] AND [ $B -eq 2 ] OR [ $C -eq 3 ] AND [ $D -ne 4 ] + ECHO TRUE +ELSE + ECHO FALSE +FI +ECHO -N "FALSE AND TRUE OR FALSE AND TRUE ---> " +IF [ $A -ne 1 ] AND [ $B -eq 2 ] OR [ $C -ne 3 ] AND [ $D -eq 4 ] + ECHO TRUE +ELSE + ECHO FALSE +FI +ECHO -N "FALSE AND TRUE OR FALSE AND FALSE ---> " +IF [ $A -ne 1 ] AND [ $B -eq 2 ] OR [ $C -ne 3 ] AND [ $D -ne 4 ] + ECHO TRUE +ELSE + ECHO FALSE +FI +ECHO -N "FALSE AND FALSE OR TRUE AND TRUE ---> " +IF [ $A -ne 1 ] AND [ $B -ne 2 ] OR [ $C -eq 3 ] AND [ $D -eq 4 ] + ECHO TRUE +ELSE + ECHO FALSE +FI +ECHO -N "FALSE AND FALSE OR TRUE AND FALSE ---> " +IF [ $A -ne 1 ] AND [ $B -ne 2 ] OR [ $C -eq 3 ] AND [ $D -ne 4 ] + ECHO TRUE +ELSE + ECHO FALSE +FI +ECHO -N "FALSE AND FALSE OR FALSE AND TRUE ---> " +IF [ $A -ne 1 ] AND [ $B -ne 2 ] OR [ $C -ne 3 ] AND [ $D -eq 4 ] + ECHO TRUE +ELSE + ECHO FALSE +FI +ECHO -N "FALSE AND FALSE OR FALSE AND FALSE ---> " +IF [ $A -ne 1 ] AND [ $B -ne 2 ] OR [ $C -ne 3 ] AND [ $D -ne 4 ] + ECHO TRUE +ELSE + ECHO FALSE +FI +MAN +TEXT /MAKE/USR/SHARE/EXAMPLES/ANDORTESTS diff --git a/MAKE/DEBUGINIT.txt b/MAKE/DEBUGINIT.txt index 677e0b92..52fdcf15 100644 --- a/MAKE/DEBUGINIT.txt +++ b/MAKE/DEBUGINIT.txt @@ -19,7 +19,7 @@ NOHUP GETTY /DEV/TTY1 ${ROOT}SBIN/LOGIN & #INSDRV UTHERNET.DRV 00:0E:3A:12:34:56 #INSDRV LANCEGS.DRV #INSDRV UTHERNET2.DRV 00:08:DC:12:34:56 -#NOHUP NETWORKD libtcpip & +#NOHUP NETWORKD LIBTCPIP & #NOHUP TELNETD & #NOHUP HTTPD ECHO *** End INIT *** diff --git a/MAKE/FULLFILES.txt b/MAKE/FULLFILES.txt index 6f060f56..d83a6f32 100644 --- a/MAKE/FULLFILES.txt +++ b/MAKE/FULLFILES.txt @@ -35,6 +35,7 @@ BIN/RM BIN/RPCDUMP BIN/SH BIN/TELNET +BIN/TERM BIN/UNPAK BIN/USERADD BIN/USERDEL diff --git a/MAKE/INITBOOT.txt b/MAKE/INITBOOT.txt index fc6cad0e..60d0682d 100644 --- a/MAKE/INITBOOT.txt +++ b/MAKE/INITBOOT.txt @@ -19,7 +19,7 @@ NOHUP GETTY /DEV/TTY4 ${ROOT}SBIN/LOGIN & #INSDRV UTHERNET.DRV 00:0E:3A:12:34:56 #INSDRV LANCEGS.DRV #INSDRV UTHERNET2.DRV 00:08:DC:12:34:56 -#NOHUP NETWORKD libtcpip & +#NOHUP NETWORKD LIBTCPIP & #NOHUP TELNETD #NOHUP HTTPD ECHO *** End INIT *** diff --git a/MAKE/TDBOOTINIT.txt b/MAKE/TDBOOTINIT.txt index 61753a58..3f438d5d 100644 --- a/MAKE/TDBOOTINIT.txt +++ b/MAKE/TDBOOTINIT.txt @@ -19,7 +19,7 @@ NOHUP GETTY /DEV/TTY4 ${ROOT}SBIN/LOGIN & #INSDRV UTHERNET.DRV 00:0E:3A:12:34:56 #INSDRV LANCEGS.DRV INSDRV UTHERNET2.DRV 00:08:DC:12:34:56 -NOHUP NETWORKD libtcpip & +NOHUP NETWORKD LIBTCPIP & NOHUP TELNETD & #NOHUP HTTPD ECHO *** End INIT *** diff --git a/TESTS/IFANDORTEST.txt b/TESTS/IFANDORTEST.txt index 59de1744..bd749c4f 100644 --- a/TESTS/IFANDORTEST.txt +++ b/TESTS/IFANDORTEST.txt @@ -287,20 +287,32 @@ ELSE SET P = $P + 1 FI FI -# 19th Test Fal OR Tru AND Tru +# 19th Test Tru OR Tru AND Fal SET T = $T + 1 -IF [ 99 -EQ 79 ] OR [ "A" = "A" ] AND [ 79 -LT 99 ] - Echo " Test 19 Fa OR Tr AND Tr : True : PASSED" +IF [ 99 -EQ 99 ] OR [ "A" = "A" ] AND [ 79 -EQ 99 ] + Echo " Test 19 Tr OR Tr AND Fa : True : PASSED" IF [ -N $Log ] - ECHO "Test 19 Fa OR Tr AND Tr : True : PASSED" >> ${Log} + ECHO "Test 19 Tr OR Tr AND Fa : True : PASSED" >> ${Log} SET P = $P + 1 FI ELSE - Echo " Test 19 Fa OR Tr AND Tr : False : FAILED" + Echo " Test 19 Tr OR Tr AND Fa : False : FAILED" IF [ -N $Log ] - ECHO "Test 19 Fa OR Tr AND Tr : False : FAILED" >> ${Log} + ECHO "Test 19 Tr OR Tr AND Fa : False : FAILED" >> ${Log} SET F = $F + 1 FI FI + SET A = 123 + SET B = 456 + SET C = "ABC" + SET D = "DEF" + SET E = "MNO" + SET F = "XYZ" + IF [ $A -lt 100 ] && [ $B -eq 456 ] || [ $C = "ABC" ] && [ $D = "GHI ] + ECHO HI + ELSE + ECHO BYE + FI # True - HI + MAN TEXT /MAKE/USR/SHARE/TESTS/IFANDORTEST