TABLE OF CONTENTS commands/ALIAS commands/ASK commands/CD commands/ECHO commands/ELSE commands/ENDCLI commands/ENDIF commands/ENDSHELL commands/ENDSKIP commands/EXECUTE commands/FAILAT commands/FAULT commands/GET commands/GETENV commands/HISTORY commands/IF commands/LAB commands/NEWCLI commands/NEWSHELL commands/PATH commands/PIPE commands/POPCD commands/PROMPT commands/PUSHCD commands/QUIT commands/RECORDER commands/RESIDENT commands/RUN commands/SET commands/SETENV commands/SKIP commands/STACK commands/SWAPCD commands/TEE commands/UNALIAS commands/UNSET commands/UNSETENV commands/WHY shell/--environment-variables-- commands/ALIAS commands/ALIAS NAME ALIAS - Set or display command aliases. FORMAT ALIAS [] [] TEMPLATE NAME,STRING/F PATH Internal FUNCTION ALIAS permits you to create aliases, or alternative names, for AmigaDOS commands. Using an alias is like replacing a sentence with a single word. With ALIAS, you can abbreviate frequently used commands or replace a standard command name with a different name. When AmigaDOS encounters , it replaces it with the defined , integrates the result with the rest of the command line, and attempts to interpret and execute the resulting line as an AmigaDOS command. So is the alias and is the command to be substituted for the alias. ALIAS displays the that will be substituted for the alias. ALIAS alone lists all current aliases. Aliases are local to the Shell in which they are defined. If you create another Shell with the NEWSHELL command, it will share the same aliases as its parent Shell. However, if you create another Shell with the Execute Command menu item, it will not recognize aliases created in your original Shell. To create a global alias that will be recognized by all Shells, insert the alias in the S:shell-startup file. An alias must be at the beginning of the command line, and you can specify arguments on the command line after the alias. However, you cannot use an alias for a series of command arguments. For instance, you cannot create a script using the LFORMAT option of the LIST command by creating an alias to represent the LFORMAT argument. You can substitute a filename or other instruction within an alias by placing square brackets ([ ]) in the . Any argument typed after the alias will be inserted at the brackets. To remove an ALIAS, use the UNALIAS command. EXAMPLES 1> ALIAS d1 DIR DF1: Typing d1 results in a directory of the contents of the disk in DF1:, just as if you had typed DIR DF1:. 1> ALIAS hex TYPE [] HEX NUMBER creates an alias called hex that displays the contents of a specified file in hexadecimal format. The brackets indicate where the filename will be inserted. If you then typed: 1> hex Myfile the contents of MyFile would be displayed in hexadecimal format with line numbers. commands/ASK commands/ASK NAME ASK - Obtain user input when executing a script file. FORMAT ASK TEMPLATE PROMPT/A,TO/K,NUMERIC/S,STRING/S PATH Internal FUNCTION ASK is used in scripts to write the to the current window, then wait for keyboard input. Valid responses are Y (yes), N (no), and Return (no). If Y is pressed, ASK sets the condition flag to 5 (WARN). If N is pressed, the condition flag is set to 0. To check the response, an IF statement can be used. If the contains spaces, it must be enclosed in quotation marks. The TO argument will save the input from the user to the named variable. If Y (yes) is pressed, the variable will contain 1. If N or Return (no) is pressed, the variable will contain 0. Additional input may be entered by the NUMERIC and STRING switches. The NUMERIC switch will only accept integer input while the STRING switch accepts both numeric and non-numeric input. The values entered may be retrieved using the TO argument. EXAMPLES Assume a script contained the following commands: ASK Continue? IF WARN ECHO Yes ELSE ECHO No ENDIF When the ASK command is reached, Continue? will appear on the screen. If Y is pressed, Yes will be displayed on the screen. If N is pressed, No will be displayed. SEE ALSO IF, ELSE, ENDIF, WARN commands/CD commands/CD NAME CD - Set, change, or display the current directory. FORMAT CD [] TEMPLATE DIR PATH Internal FUNCTION CD with no arguments displays the name of the current directory. When a valid directory name is given, CD makes the named directory the current directory. CD does not search through the disk for the specified directory. It expects it to be in the current directory. If it is not, you must give a complete path to the directory. If CD cannot find the specified directory in the current directory or in the given path, a Can't find error message is displayed. If you want to move up a level in the filing hierarchy to the parent directory of the current directory, type CD followed by a space and a single slash (/). Moving to another directory in the parent can be done at the same time by including its name after the slash. If the current directory is a root directory, CD / will have no effect. Multiple slashes are allowed; each slash refers to an additional higher level. When using multiple slashes, leave no spaces between them. To move directly to the root directory of the current device, use CD followed by a space and a colon. CD also supports pattern matching. If more than one directory matches the given pattern, an error message is displayed. EXAMPLES 1> CD DF1:Work sets the current directory to the Work directory on the disk in drive DF1:. 1> CD SYS:Com/Basic makes the subdirectory Basic in the Com directory the current directory. 1> CD // moves up two levels in the directory structure and makes SYS: the current directory. 1> CD SYS:Li#? uses the #? pattern to match with the Libs directory. commands/ECHO commands/ECHO NAME ECHO - Display a string. FORMAT ECHO [] [NOLINE] [FIRST ] [LEN ] TEMPLATE ,NOLINE/S,FIRST/K/N,LEN/K/N PATH Internal FUNCTION ECHO writes the specified string to the current output window or device. By default this is the screen, but it could be to any device or file. When the string contains spaces, the whole string must be enclosed in double quotes. (ECHO is commonly used in scripts.) When the NOLINE option is specified, ECHO does not automatically move the cursor to the next line after printing the string. The FIRST and LEN options allow the echoing of a substring. FIRST indicates the character position to begin the echo; LEN indicates the number of characters of the substring to echo, beginning with the first character. If the FIRST option is omitted and only the LEN keyword is given, the substring printed will consist of the rightmost characters of the main string. For instance, if your string is 20 characters long and you specify LEN 4, the 17th, 18th, 19th, and 20th characters of the string will be echoed. EXAMPLES 1> ECHO "hello out there!" hello out there! 1> ECHO "hello out there!" NOLINE FIRST 0 LEN 5 hello1> commands/ELSE commands/ELSE NAME ELSE - Specify an alternative for an IF statement in a script file. FORMAT ELSE TEMPLATE (none) PATH Internal FUNCTION ELSE is used in an IF block of a script to specify an alternative action in case the IF condition is not true. If the IF condition is not true, execution of the script will jump from the IF line to the line after ELSE; all intervening commands will be skipped. If the IF condition is true, the commands immediately following the IF statement are executed up to the ELSE. Then, execution skips to the ENDIF statement that concludes the IF block. EXAMPLES Assume a script, call Display, contained the following block: IF exists TYPE OPT n ELSE ECHO " is not in this directory" ENDIF To execute this script, you could type: 1> EXECUTE Display work/prg2 If the work/prg2 file can be found in the current directory, the TYPE OPT n command will be executed. The work/prg2 file will be displayed on the screen with line numbers. If the work/prg2 file cannot be found in the current directory, the script will skip ahead to the ECHO " is not in this directory" command. The message work/prg2 is not in this directory will be displayed in the Shell window. NOTES ELSE can only be used in script files. SEE ALSO IF, ENDIF, EXECUTE commands/ENDCLI commands/ENDCLI NAME ENDCLI - End a Shell process. FORMAT ENDCLI TEMPLATE (none) PATH Internal FUNCTION ENDCLI ends a Shell process. SEE ALSO ENDSHELL commands/ENDIF commands/ENDIF NAME ENDIF - Terminate an IF block in a script file. FORMAT ENDIF TEMPLATE (none) PATH Internal FUNCTION ENDIF is used in scripts at the end of an IF block. If the IF condition is not true, or if the true condition commands were executed and an ELSE has been encountered, the execution of the script will skip to the next ENDIF command. Every IF statement must be terminated by an ENDIF. The ENDIF applies to the most recent IF or ELSE command. NOTES ENDIF can only be used in script files. SEE ALSO IF, ELSE commands/ENDSHELL commands/ENDSHELL NAME ENDSHELL - End a Shell process. FORMAT ENDSHELL TEMPLATE (none) PATH Internal FUNCTION ENDSHELL ends a Shell process. ENDSHELL should only be used when the Workbench is loaded or another Shell is running. If you have quit the Workbench and you close your only Shell, you will be unable to communicate with the Amiga. Your only recourse will be to reboot. The Shell window may not close if any processes that were launched from the Shell are still running. Even though the window stays opens, the Shell will not accept new input. You must terminate those processes before the window will close. For instance, if you opened an editor from the Shell, the Shell window will not close until you exit the editor. commands/ENDSKIP commands/ENDSKIP NAME ENDSKIP - Terminate a SKIP search block in a script file. FORMAT ENDSKIP TEMPLATE (none) PATH Internal FUNCTION ENDSKIP is used in scripts to define the end of a SKIP search block. (The SKIP command allows you to jump over intervening commands if a certain condition is met.) When an ENDSKIP is encountered, execution of the script resumes at the line following the ENDSKIP. The return code is set to 5 (WARN). NOTES ENDSKIP can only be used in script files. SEE ALSO SKIP commands/EXECUTE commands/EXECUTE NAME EXECUTE - Execute a script with optional argument substitution. FORMAT EXECUTE