Log In | Not a Member? | Support | |
SYNTAX
Begin DESCRIPTION The Begin…End control structure groups commands for pipe specifications, conditional execution, and redirection. Commands must be separated by either carriage returns or semicolons. If you use an operator for pipe specification (|), conditional execution (&& and ||), or redirection (<, >, >>, ≥, ≥≥, ∑, ∑∑), the operator must appear after End and applies to all of the enclosed commands, if they are not themselves redirected.
Note INPUT None OUTPUT None STATUS Begin…End returns the status code of the last command executed. If no commands appear between Begin and End, it returns 0. PARAMETERS command… Specifies the commands grouped by Begin…End. Separate commands with either carriage returns or semicolons. OPTIONS None EXAMPLES The following commands save the current definitions of all variables, exports, aliases, and menus in the SavedState file.
Begin Notice that the output specification following End applies to all the commands within Begin…End. This is identical to the following: (Set; Export; Alias; AddMenu) > SavedState The Set, Export, Alias, and AddMenu commands write their output in the form of commands. For instance, Alias Dir Directory shows that Dir is a command alias for the Directory command. These commands can be executed to redefine variables, exports, command aliases, and menus, respectively. Therefore, upon executing the grouped commands, the command line Execute SavedState restores all these definitions. You must execute the script so that the variables and command aliases apply to the current scope.
Note SEE ALSO The Suspend script located in your {MPW} folder.
|