.! .! File: SD.HELP .! .! Author: Hunter Goatley .! .! Date: March 17, 1997 .! .! Abstract: Source file to build RUNOFF .RNH file for SD on-line help .! .! .!
SD HG SD (Set Default) is a program that lets you quickly and easily perform DCL SET DEFAULT operations. SD provides a number of shortcuts for moving around directory trees. For more information, consult the subtopic Command_Summary. $ SD [options] .! Command_Summary Set/Show Default Directory SD ^ Go up one subdirectory level SD @ Go to top level of current directory (enter TOP for help) SD . Go to login default directory and disk SD #n Go to directory in n'th entry of the SD stack SD # Set default to stack entry #1 (toggle stack entries) SD >X Set default to [z.X] when currently in [z.y] SD > Move to alphabetically next directory at same level SD < Move to alphabetically previous directory at same level SD .X Set default to [current.X] SD X.Y.Z Set default to [X.Y.Z] (enter X for help) SD % Push the current default onto the stack SD * Show the SD stack (enter STACK for help) SD ? Show this SD help information SD & Unconceal a directory specification SD Show the current default Enter Multiple_Commands for help showing how to do multiple SD functions in one call. #n SD maintains a stack of the last sixteen directories visited. Entering "SD #n" sets default to the n'th previous entry in the SD stack, where "n" is a hexadecimal number (0 through F). If n is omitted, the 1st previous entry on the stack becomes the new default. Unlike "SD #1," "SD #" swaps the 0th and 1st entries on the stack. If you toggle between two directories frequently, using "SD #" will prevent your stack from being filled with only those two directory specifications. . Sets default to the login default directory and disk. .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 a default of [A.B.X] You can abbreviate the subdirectory name or supply a name with wildcard characters ("%" and "*") to avoid typing lengthy subdirectory names. > Moves forward to the next directory (alphabetically) at the same directory level as the current directory. For example, if the current default is [A.B.C], entering "SD >" will result in a default of [A.B.D]. >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]. You can abbreviate the directory name or supply a name with wildcard characters ("%" and "*") to avoid typing lengthy directory names. < Moves backward to the previous directory (alphabetically) at the same directory level as the current directory. For example, if the current default is [A.B.C], entering "SD <" will result in a default of [A.B.B]. % SD maintains a stack of the last sixteen directories visited. If SET DEFAULT or another method is used to change the default, the stack will not be updated and the new default will not show up on the stack. Specifying "%" tells SD to update the stack by pushing the current default directory. @ Entering "SD @" sets default to the top level directory. If currently in [X.Y.Z], you will then be in [X]. X Sets default to directory [X] on the current device. Note that square brackets are not required around the directory name, though they are allowed. 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]). ^ Sets default to the next highest directory level. If default is [X.Y.Z], execution of "SD ^" will set default to [X.Y]. You may specify more than one "^" to move up more than one level ("SD ^^^" to move up three levels). If the current default is a top-level directory, the default it changed to [000000]. & "Unconceals" a directory by translating any concealed logical names in a directory specification. For example: $ sho log hg_src "HG_SRC" = "DKA100:[SOURCES.]" (LNM$SYSTEM_TABLE) $ sd hg_src:hgsd.source HG_SRC:[HGSD.SOURCE] $ sd & DKA100:[SOURCES.HGSD.SOURCE] $ ? Displays the online help for SD. 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. Limitations SD does not support multiple default directories or defaults on other nodes. Logical-names SD translates logical names if given. For example, "SD SYS$HELP" will set the default to the translation for SYS$HELP. SD also defines a logical name, SD_PREV, when you leave a directory that points back to that previous directory. This makes it easier to copy files from a previous directory to a current directory, for example. You might define an even shorter logical, say X, equated to SD_PREV to make it even easier. Multiple_Commands In certain cases, SD can do two functions in one call. For example, commands that move to another default directory can be combined: $ SD . .Y (go to subdirectory Y of login default directory) $ SD ^^ (go up two levels; note difference from SD @) $ SD #3 >X (go to stack entry 3, then over to X) SD_ENTER.COM When SD changes the default directory, it looks in the new directory for a command procedure called SD_ENTER.COM. If that procedure is found, it is executed, allowing for certain commands to be executed when that directory is entered. For example, certain directory-specific logical names may be defined in SD_ENTER.COM. Stack SD maintains a stack of the last 16 directories visited. Entering "SD *" displays the SD stack, with the current directory at the top. Entering "SD #n" sets the default to the corresponding entry. .! Author HGSD was written by Hunter Goatley. Please address all bug reports to . Copyright © 1987,1997, 1998, Hunter Goatley. All rights reserved. .! Examples The following examples demonstrate the use of SD. database. |1. $ SD | HG_SRC:[HGSD.SOURCE] | $ When SD is executed without any parameters, it simply displays the current default directory. |2. $ sd . .test | USER:[HUNTER.TEST] | $ This example changes the default directory to the subdirectory [.TEST] under the user's login directory. |3. $ sd .yyz | DKA100:[SOURCES.HGSD.SOURCE.YYZ] | $ sd ^^>ftp | DKA100:[SOURCES.FTP] | $ This example moves up two directory levels, then over to the directory FTP. |4. $ sd dka100:so.mx.r | DKA100:[SOURCES.MX.ROUTER] | $ This example demonstrates the abbreviation of directory names. .! Setting_the_DCL_Prompt SD can set your DCL prompt to your current default directory. In order to enable this feature, you must be running a version of SD with the prompt support enabled, and you must have the logical HG_SD_SET_PROMPT defined: $ define hg_sd_set_prompt true Note that you must have CMEXEC privilege, or SD must be installed with CMEXEC, in order to set the DCL prompt. The maximum prompt length is 32. Directory names longer than 31 characters will be shown with "*" replacing part of the name: $ sd disk$vmssys:users.hunter.some.subdirectory DISK$VMSSYS:[USERS.HUNTER.SOME.SUBDIRECTORY] DISK$VMSSYS:*.SOME.SUBDIRECTORY]