1 SD_$                            
! improved by Robert L. Boyd, GE MEC 12-NOV-1982, 14-JAN-1983
! Corresponds to SD version created by Stan Knutson, MIT/JCF 9/2/79
! based on previous version by R. Bryan, MIT/LCS
Set/show default directories.

Eases the problems in handling multiples subdirectories.

Format:
 a.  SD			Show Default
 b.  SD ^		Go up one subdirectory level
 c.  SD ^^		Go to top level of current directory
 d.  SD >TWO		Go to .TWO of this subdirectory level
 e.  SD .		Restore login default directory and disk
 f.  SD .TWO		Set Default to [Current.TWO]
 g.  SD ONE.TWO.THREE	Set default to [ONE.TWO.THREE]
 h.  SD <n		Restore the n'th previous entry from the
			directory stack.  (D=1)
 i.  SD <<		List the directory stack
 j.  SD *		List Subdirectories under this one...
 k.  SD **		List subdirectories of the current top
 l.  SD ?		Print the SD help file.
 m.  SD \ modifier	Apply modification to erroneous previous entry
2 ^
 Set 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.
2 ^^
 Set default to the top level directory.  If default is [X.Y.Z],
 execution of "SD ^^" results in default of [X]
2 >x
 Set 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].
2 .
 Set default to the login default.
2 .x
 Set 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]
2 <n
 Set default to the n'th previous entry in the directory stack.
 If n is ommitted, 1 is assumed. 
2 <<
 Print the directory stack, with the current directory at the top.
 "SD <n" set the default to the n+1'st line.
2 *
 Lists all subdirectories under the current directory
2 **
 Lists all subdirectories of the current top level directory.
2 ?
 Print the SD help file.  (same as "HELP SD")
2 Logical_names
 SD translates logical names if given.  For example, "SD SYS$HELP:"
 will set the default to the translation for SYS$HELP.
2 Errors
 SD checks for the existence of the directory being entered,
 and prints an error if it is not found.  The default directory is
 left unchanged.
2 SDCLOSE
 If a file "SDCLOSE.COM" exists in the old directory and the new
 directory is not a subdirectory of the old one, it is executed.
 This allows symbol definitions related to that directory to be
 deleted upon exit. 
2 SDENTRY
 If a file "SDENTRY.COM" exists in the new directory, it is executed.
 This allows symbol definitions related to that directory.
2 \
 In the event of an invalid directory being entered, SD will save the
 invalid specification.  Then by using \ plus one of the modifiers
 that is permitted, the modification will be applied to the invalid
 directory specification.
 
 For example, you enter 

 SD [A.B.C.D]

 when the actual structure only goes out to [A.B.C].  SD will then
 tell you that [A.B.C.D] does not exist, but will remember what you
 entered.  You may then enter

 SD \ ^
 
 and SD will set your default to [A.B.C]
 
 Any of the modifiers b-f may be applied to an invalid specification.
