SD Users' Guide Set/Show Default Utility SD Version 4.4A April, 1988 SD is a utility which gives a shortened command for SET DEFAULT and SHOW DEFAULT, as well as giving expanded capabilities for these commands. SD with no parameters is equivalent to SHOW DEFAULT. SD with paramaters is equivalent to SET DEFAULT. Using SD RUNNING SD: from the VMS prompt - $ SD EXITING SD: SD will exit after accomplishing its work. GETTING HELP: Type SD ? or SD HELP. If you are in the "tree" display, press the PF2 or HELP key for assistance. SD was initially submitted in 1984 by Alan L. Zirkle, Naval Surface Weapons Center, and has been improved (and submitted to DECUS) by him since that time. This version is a spin-off from his submission to the Spring 1986 Symposium Tape, and was extensively re-written by Dale E. Coy, Los Alamos National Laboratory. Constructive suggestions, "bug reports", etc. should be referred to the system manager. Command Summary SD Show the current default SD X Set default to Directory [X] SD .X Set default to [current.X] SD X.Y.Z Set default to [X.Y.Z] SD ^ Go up one subdirectory level SD ^^ Go to top level of current directory SD . Go to login default directory and disk SD X Set default to [z.X] when currently in [z.y] SD > Traverse horizontally SD \ Fully traverse the directory tree SD n Set default to n'th predefined directory SD << Show the SD stack SD * Show (and go to) subdirectories under current default SD ? Show SD help information Multiple SD functions may be used in one call. SD X Sets default to directory [X] 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 DRA0:[X.Y] to DRA1:[X.Y]). SD .X Sets default to the subdirectory named X at the next lower level. If the current default is [A.B], then SD .X will result in default of [A.B.X] SD ^ Sets default to the next highest directory level. If default 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 the login default directory and disk. 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. SD n Sets default to the n'th predefined directory. These are usually defined at login, using global symbols SD__nn. You can define or redefine these yourself, as in the following example: $ SD__02 == "SYS$SYSDEVICE:[MYDIR.MYSUB]" 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 the definition. The definition can also be of a device only, such as "_DRC0:" or "SYS$SYSROOT:". If so, then you can combine it with another entry, such as: $ SD 1 X.Y.Z * DM Directory Traverse SD > traverses horizontally, and SD \ traverses entire directory trees. When doing either type of traversal, you will get the error message "End of traversal reached" when there are no more directories to traverse. 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. SD \ Fully traverses the directory tree under the current master directory, starting at the current default. For instance, if the current directory 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's STACK SD maintains a stack of the last twenty directories visited. Entering SD << displays the SD stack, with the current directory at the top. You may use the up and down "arrow" keys to position the cursor to a stack entry. Then, pressing Return or Select will move you to that directory. T and B move to the Top or Bottom of the stack. You may quit without changing directories by pressing any other key (such as space or "Q"). The stack display will remain on the screen. Entering SD T ctrl/w down-arrow right-arrow B left-arrow next screen prev screen PF2 (help) right-arrow Only four levels of subdirectories are shown at one time (six if you have a 132-column terminal); if lower levels exist, the parent directory shows a line pointing to the right. If a directory name is too long, it will be truncated and a diamond will be displayed after it. Truncation will occur for names longer than 17 characters. Pressing the Return or Select keys will place you in the selected directory To print a copy of the diagram, press P (The PF1 key, followed by p or P). To change printers, press A . The printed copy will use DEC's line-drawing character set, if your printer supports it. Arrow Keys - Move around in the tree. Next Screen (VT2xx/3xx) - Move DOWN in Current Column. Prev Screen (VT2xx/3xx) - Move UP in Current Column. Return/Select/Enter/Do - Select directory to "GoTo". Gold T - Go to TOP of Current Column. Gold B - Go to BOTTOM of Current Column. Gold Right-arrow - Go to the Rightmost Column. Gold Left-arrow - Go to the First Column. Gold P - Print the Tree display (on your default printer). Gold A - Change your default printer. Press any other key to exit from the Tree Display. Multiple SD Commands In most cases, SD can do multiple functions in one call. Space(s) must separate the functions. A. A * can be done after all operations: $ SD X.Y * B. You can do a DIRECTORY after all operations: $ SD >X DIR /DATE (you must use the abbreviation DIR) C. You can enter DM after all operations: $ SD >X DM (you must use the abbreviation DM) D. On GO operations, you can have it do another movement: $ SD . .Y (go to subdirectory Y of login default directory) $ SD ^ ^ (go up two levels; note difference from SD ^^ ) $ SD <3 >X (the explanation of this is left as an exercise to the user) E. If you use Multiple operations, the order of execution is: oo All Explicit Movements oo * (Show Tree) oo << (Show Stack) oo DIR oo DM Initializing You may initialize SD's Stack and your own Predefined Directories. These are usually defined at login (in your LOGIN.COM), but Predefined Directories may be changed at any time. Such definitions last until you logout or redefine them. If you want them to be permanent, put them in your LOGIN.COM file. Initializing SD's Stack allows you to begin with the stack as you like it. However, subsequent use of SD will change the stack contents. Initializing the Predefined Directories allows you to type "SD n" at any time and be moved to a specific directory. Initializing the Stack Initialize the SD Stack at login (in your LOGIN.COM file), using global symbols SD_SLOTnn and the global symbol SD_STACK_POINTER. You must define all 20 slots as in the following example: $ SD_STACK_POINTER == "00" two zeros $ SD_SLOT00 == "SYS$LOGIN" $ SD_SLOT01 == "SYS$SYSDEVICE:[MYDIR.MYSUB]" ... $ SD_SLOT19 == "SYS$SYSDEVICE:[MYDIR.MYSUB]" Note that you must include the square brackets in the definition. Duplicates are allowed. Initializing Predefined Directories Initialize the Predefined Directories at login (in your LOGIN.COM file) or at any time you wish, using global symbols SD__nn. You may define these as you desire (and with the numbers you choose) as in the following example: $ SD__02 == "SYS$SYSDEVICE:[MYDIR.MYSUB]" $ SD__99 == "DISK$USER99:[FOO.BAR]" Note that you must include the square brackets in the definition. You may then use the command "SD 99" (or whatever) to move to your n'th predefined directory. The definition can also be of a device only, such as "_DRC0:" or "SYS$SYSROOT:". If so, then you can combine it with other entries, such as: $ SD 1 X.Y.Z * DM Miscellaneous Information Errors SD checks for the existence of the directory being entered, and prints an error if it is not found, or if the device is not mounted. Logical-names SD translates logical names if given. For example, SD SYS$HELP will set the default to the translation for SYS$HELP. Highlighting The SD Tree and Stack displays normally highlight (bold) entries as your cursor moves through the display. In certain circumstances, you may wish to disable this feature. You might want to do this if your terminal does not support highlighting, or if you are using a slow baud rate (highlighting does take time). To eliminate dynamic highlighting, define a symbol: $ DM$HIGHLIGHT :== N Credits SD was initially submitted in 1984 by Alan L. Zirkle, Naval Surface Weapons Center, and has been improved (and submitted to DECUS) by him since that time. This version is a spin-off from his submission to the Spring 1986 Symposium Tape, and was extensively re-written by Dale E. Coy, Los Alamos National Laboratory. This revision uses entirely FORTRAN and MACRO code, as well as the SMG screen interface. It also incorporates an interactive stack of 20 directories, and an interactive "Tree" display.