)0 aaaaaa aaaaaaaa aaa aa aaa aaa aaa aaa aaa aaaaaa aaa aaa SD -- Set/Show Default Directory aaa aaa aaa aa aaa aaa aaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaa aaaaaaaa  SD Show the current default directory and disk SD ^ Go up one subdirectory level SD ^^ Go to top level of current directory structure SD . Go to login default directory and disk SD << Show the SD stack of 20 previous defaults SD < Go to the default before the current one SD X Set default to [z.X] when currently in [z.y] SD > Traverse horizontally SD .X Set default to [current.X] SD X.Y.Z Set default to [X.Y.Z] SD n Set default to nth predefined directory SD \ Fully traverse the directory tree SD * Show subdirectories under current default SD ? Show SD help information (SD HELP or SD /HELP also work) _________________________________________________________________________ SD ^ Sets default to the next highest directory level. If the current de- fault is [X.Y.Z], execution of SD ^ will set default to [X.Y]. If the current default is a top-level directory, nothing happens. SD ^^ Sets default to the top level directory. If currently in [X.Y.Z], you will then be in [X]. SD . Sets default to your login default directory and disk. SD < Sets default to to the directory you were in immediately before your current setting. SD  Sets default to the next directory (in alphabetical order) on this level. If the current directory is [A.B], then successive uses of SD > will set the default to [A.C], [A.D], etc. If the current default is a top-level directory, nothing happens. SD >X Sets default to the directory "X" at this subdirectory level. If the current directory is [A.B.C] then SD >X will set default to [A.B.X]. If the current default is a top-level directory, nothing happens. Wildcards (* and %) may be used in the directory names; SD will go to the first directory matching the specification. SD \ Fully traverses the directory tree under the current master directory, starting at the current default. For instance, if the current direc- tory is [A.B], then successive uses of SD \ will set the default to: [A.B.B1] [A.B.B2] [A.C] [A.C.C1] [A.C.C1.C1X] [A.D] etc. If the traverse starts from a master directory, then ALL of the tree under it will be traversed; the above example starts in the middle of the tree, and shows that parts of the tree 'before' the starting point (in alphabetical order) are not traversed. SD .X Sets default to the subdirectory named X at the next lower level. If the current default is [A.B], then SD .X results in a default of [A.B.X], or SD .X.Y.Z results in a default of [A.B.X.Y.Z]. Wildcards (* and %) may be used in the directory names; SD will go to the first directory matching the specification. SD X.Y.Z Sets default to directory [X.Y.Z] on the current device. Note that square brackets are not required around the directory name; they are allowed, however. Examples: $ SD MYDIR $ SD NEWDIR.A.B You can also move to a different device, by executing: $ SD device:directory The colon is required; you may follow the colon with a blank. If you just enter a device, you will go to your current default on the new device (e.g. from DUA0:[X.Y] to DUA1:[X.Y]). Wildcards (* and %) may be used in the directory names; SD will go to the first directory matching the specification. SD page 3 SD n Sets default to the nth predefined directory. You can define or redefine these yourself, as in the following example: $ SD /2=MYDISK:[MYDIR.MYSUB] /3=MYDISK:[MYDIR.OTHER] Such definitions last until you logout or redefine them. If you want them to be permanent, put them in your LOGIN.COM file. Note that you must include the square brackets in definitions. A definition can also be of a device only, such as "DUA0:" or "SYS$SYSROOT:". If so, then you can combine it with another entry, such as: $ SD 1 X.Y.Z On the SGS VAXcluster, numbers 1-7 are defined for you to point to each UDISKn. For example,  SD 2 ABC  will move to UDISK2:[ABC]. SD /VERSION and SD ? Displays SD's current version number. In the future, SD ? will no longer do this. SD << SD maintains a stack of the last twenty directories visited. Entering SD << displays the SD stack, with the current directory at the top. You can use the up-arrow and down-arrow keys to move the cursor to an element of the stack, then use the ENTER, SELECT, or DO key to set the default to that directory. If directory names are too long to fit on the screen, -> is displayed at the right margin. The left-arrow and right-arrow keys can be used to view the rest of the name. The SPACE bar exits the stack display without moving to a new directory. The Control/W key refreshes the screen. SD * Builds a display on VTnnn screens showing subdirectories under the cur- rent directory. When the display is complete, you may enter a SPACE to exit the display, or you may travel through the display using EDT-like key commands; hit the HELP key for definitions. You may highlight any directory in the display using the arrow keys. To travel to the highlighted directory, hit the ENTER, SELECT, or DO key. Often the display is too wide to fit on the screen. Keys are defined to change the screen width to 132 and 80, and to shift the screen to view off-screen portions. The Control/W key refreshes the screen. SD page 4 Errors SD checks for the existence of the directory being entered, and prints an error if it is not found, if the device is not mounted, or if you don't have privilege to use the directory. SDENTRY If a file SDENTRY.COM exists in the new directory, it is executed. This allows you to define symbols related to that directory. If you don't want SD to execute SDENTRY or SDEXIT procedures, set global DCL symbol SD_COM to a string value beginning with "N". If you set SD_COM to a string value beginning with "Y", SD will tell you when it runs these procedures. SDEXIT If a file SDEXIT.COM exists in the current default directory, it is executed before a move is made to a new directory. This allows cleaning up of symbol or logical name definitions when leaving the current directory. SDEXIT.COM will find P1 set to the name of the directory where SD is traveling to. Normally, this feature would be used in conjunction with SDENTRY. If you don't want SD to execute SDENTRY or SDEXIT procedures, set global DCL symbol SD_COM to a string value beginning with "N". If you set SD_COM to a string value beginning with "Y", SD will tell you when it runs these procedures. SD.COM If a file SYS$LOGIN:SD.COM exists, and if global DCL symbol SD_COM is set to a value of "xY" (where "x" is any character), then SD.COM is executed before a move is made to a new directory; it will find P1 set to the name of the directory where SD is traveling to. The procedure will be called before any SDEXIT.COM is called. An error message will be displayed if you have not provided an SD.COM. This provides a way, for example, for users to easily change the DCL prompt based on what directory they are going to. Users on VT3nn or VT4nn terminals can use this to put the new directory name in the 25th line. Multiple Functions In certain cases, SD can do multiple functions in one call. Blank(s) must separate the functions. A. A * can be done after all operations except SHOWs: $ SD X.Y * SD page 5 B. You can do a DIRECTORY after all operations except SHOWs: $ SD >X DIR /DATE (you must use the abbreviation DIR) C. On GO operations, you can have it do multiple movements: $ SD . .Y (go to subdirectory Y of login default directory) $ SD ^ ^ (go up two levels; note difference from SD ^^ ) $ SD < >X (the explanation of this is left as an exercise to the user) Logical Names SD translates logical names if given. For example, SD SYS$HELP will set the default to SYS$SYSROOT:[SYSHLP]. If a logical name translates to a full file name, SD only uses the device and directory portions. Saving SD Context Over Logouts SD can save its history over logouts. Do SD /SAVE to save it before you log out, and SD /RESTORE when you log in. This works best if you create a LOGOUT.COM. An example of setting this feature up is: LOGIN.COM: $ IF F$MODE() .EQS. "INTERACTIVE" $ THEN $ SD /RESTORE $ LO*GOUT == "@SYS$LOGIN:LOGOUT" $ ENDIF LOGOUT.COM: $ SD /SAVE $ LOGOUT = "" ! Prevents looping $ LOGOUT SD uses the file SYS$LOGIN:SD.HISTORY to save this context. SD's Use of DCL Symbols SD uses Global DCL Symbols to maintain its history stack and to hold the definitions of the predefined directories. Deleting or changing the values of these symbols will cause SD to work incorrectly. The names of the symbols are: SD_SLOTn, where n=0 to 19 (the stack) SD_SP (stack pointer) SD__i, where i is an integer (predefined directories) Also, the use of Global DCL Symbol SD_COM is described elsewhere in this document, and SD itself is called as a "foreign command", using Global DCL Symbol SD. This is NSWC$ROOT:[DOC]SD.LQP. Updated 23 January 1991 for SD 4.0. SD page 6 System Managers When a privileged user executes SD, the following differences apply: SD @username Goes to login directory of the specified user (if username is blank, goes to your login directory) SD # If in [SYSi.xxx], goes to [SYSj.xxx], where j=i+1 in hex SD #n If in [SYSi.xxx], goes to [SYSn.xxx]; i and n are hex The latter two are for traversing VMS system roots, and work only if currently in a directory named [SYSn.xxxx], where n is any hex number, and xxxx is any subdirectory(s). SD >X, and SD >, if at a top-level directory, will go to the next alphabetic directory. SD ^ from a top-level directory will go to [000000]. These are all no-ops for unprivileged users. Also, SD /TEST [params] will run SD in "SD Debug" mode. This is NSWC$ROOT:[DOC]SD.LQP. Updated 23 January 1991 for SD 4.0.