_____________________________ /_____________________________\ / \ | Inside Vax/Vms | | Using Command Procedures | | | | By | | Master Blaster | \_____________________________/ Advanced Telecommunications Inc. Note: The following is geared for the more advanvced hacker. Part 1: Using Command Procedures. ----- ------- ---------- You can use command procedures to automate sequences of commands that you use quite often. For example, if you always se the DIRECTORY command after you move to a Sub-Directory here work files are kept, you can write a simple command procedure to issue the SET DEFAULT and DIRECTORY commands for you. he following example, GO_DIR.COM, contains two commands: $ Set Default [perry.accounts] $ directory Instead of using each command alone, you can execute GO_DIR.COM with the @ command: $ @Go_Dir his command tells the DCL command interpreter to read the file O_DIR.COM and executes the commands in the file. So the command nterpreter sets your default directory to[PERRY.ACCOUNTS] and sues the DIRECTORY command. ote: DCL means Digital Command Language. (sorry) Formatting Command Procedures ---------- ------- ---------- Use the DCL command CREATE to create and format a command rocedure. When you name the command procedure, use the default ile type COM. If you use this default, you don't have to use the ile type when you execute the procedure with the @ command. Command procedures contain DCL commands that you want the DCL command intepreter to execute and data lines that are used by hese commands. Commands must begin with a dollar sign. You can tart the command string just after the dollar sign. Data lines do not start with a dollar sign. Data lines are used as input data for commands. Data lines are used by the most ecently issued command. he following examle shows command and data lines in a command rocedure. $ mail SEND HOMAS Y MEMO id you get my memo? Show users thomas The first line is a command and must start with a "$". The next ines are data lines that are used by the mail function; these lines must not start with "$". Using Multiple Lines for One Command ----- -------- ----- --- --- ------- If you are writing a command that includes many qualifers, ou can make the command procedure more readable by listing the ualifers on seperate lines rather than running them together. To o this, use the hyphen as a continuation character. Don't start he continued line with "$". For example: $ print test.out - /after=18:00 - /copies=10 - /queue=lpb0: xecuting Command Procedures -------- ------- ---------- You can execute command procedures in two modes: interactive nd batch. In interactive mode, the commands in the command rocedure are executing as if you were typing them. You cannot xecute any other commands from your computer. In batch mode, he system creates a seprate process to run the command procedure. After you use a batch job you can continue to use e system while it executes. xecuting Command Procedures Interactively -------- ------- ---------- ------------- To execute a command procedure interactively, type the "@" command followed by the file specifications. If you don't enter e entire command specification, the system will use the current disk, directory, and file default. Changing Command Levels -------- ------- ------ A command level is the DCL level from which you issue commands. When you log in and type commands at your Computer, u are issuing commands at your level zero. If you execute a procedure, the commands in the procedure are executed at command evel 1. When the procedure ends and the DCL prompt is on your creen, you are back at levil zero. A System Login File - ------ ----- ---- If a system login file exists, it is executed before the personal file. When the system login file ends, control is assed to the personal login file. System and group login files low a system manager to make sure certian files are executed when a person logs in. To make a system login file, you have to have a managers account, you use the name SYS$SYLOGIN to make the login file. Personal Login Files ------- ----- ----- After executing a system or group login file, the system xecutes a personal login file. Use a personal login file to execute commands that you want to that you want to issue verytime you login. Name the login command procedure LOGIN.COM d put it in the default login directory. Defineing Parameters or Qualifers --------- ---------- -- --------- You can create a command procedure that specifies only parameters and(or) qualifers and then use the command procedure thin a DCL command string. This type of command procedure is useful when there is a set of parimeters or qualifiers that you requently use with one or more particular commands. To execute he command string where you would normally use the qualifiers or arameters. For example: You could create a command procedure that contains these qualifiers. /DEBUG/SYMBOL_TABLE/MAP/FULL/CROSS_REFERENCE o use this command procedure, execute it on the command line here you would otherwise place qualifiers. For example, if you ame the command procedure DEFLINK.COM, you would use the ollowing command line to link to an object module name YNAPSE.OBJ with the qualifiers that you specified in the command rocedure: $ LINK SYNAPSE@DEFLINK he next example shows a command procedure named PARM.COM that contains parameters: HAP1, CHAP2 To execute the procedure, use it in a command string in place of a parameter name: $ DIRECTORY @PARAM s the others in this set are completed, they should stay in a oup. ________________________________________________ \ H)ackRite 1986 - Advanced Telecommunications Inc. ________________________________________________/ DOWNLOADED FROM P-80 SYSTEMS.....