01/02/90 working_dir, wd, print_wdir, pwd Syntax as a command: wd {LOCATIONS} {-control_arg} Syntax as an active function: [wd {LOCATIONS}] Function: prints or returns the pathname of the current working directory. Optional arguments can be given to print or return entries on the stack of working directories. Refer to the change_wdir command for a description of the working directory stack. Arguments: LOCATIONS select entries on the working directory stack to be printed or returned. LOCATION can be an integer position N from the top of the stack; or a text LABEL associated with a stack entry; or one of the reserved words first (f), last (l) or all (a). The reserved word first identifies the current working directory (which is not on the stack of prior working directories and is displayed above stack position 1); last identifies the bottom stack entry; and all identifies the current working directory plus all stacked directories. More than one LOCATION can be given to select several entries. Individual locations are separated by a space. A LOCATION_RANGE is given by a starting and ending LOCATION separated by a colon. For example, f:2 identifies the current working directory and the top two directories on the stack, and 1:XXX identifies stack entries from the top of the stack to the entry with label XXX. Control arguments: -header, -he displays a heading of the form: LOC LABEL PATHNAME . The default is to print a heading when more than one directory is displayed. -no_header, -nhe suppresses the heading before the stack contents are displayed. [default] Notes: Since the working_dir is returned in quotes, the command processor treats it as a single argument regardless of special characters in the name. The current working directory is located at location zero. The most recent prior working directory is at the stack position 1 and the least recent prior working directory is at the Nth (last position). If a stack of prior working directories is empty then only the current working directory is printed. For the case when the current working directory has been deleted, an attempt to print it out will display the "directory has been deleted" message in square brackets, separated from the directory pathname by a blank space. This does not apply when one or more prior working directories on the stack have been deleted. See also the change_wdir (cwd) command for stack features. Examples: Assume the stack looks like the following: 0 >udd>m>tai>archive_dev 1 >udd>m>tai>abbrev_dev 2 XXX >udd>m>tai>cwd_dev 3 >udd>m>tai then ! wd XXX 2 XXX >udd>m>tai>cwd_dev ! wd 2 -he LOC LABEL PATHNAME 2 XXX >udd>m>tai>cwd_dev ! wd f:XXX LOC LABEL PATHNAME 0 >udd>m>tai>archive_dev 1 >udd>m>tai>abbrev_dev 2 XXX >udd>m>tai>cwd_dev ! string [wd XXX] >udd>m>tai>cwd_dev ! string [wd 2] >udd>m>tai>cwd_dev ! string [wd a] >udd>m>tai>archive_dev >udd>m>tai>abbrev_dev >udd>m>tai>cwd_dev >udd>m>tai ! dd >udd>m>tai>archive_dev ! wd a LOC LABEL PATHNAME 0 >udd>m>tai>archive_dev [directory has been deleted] 1 >udd>m>tai>abbrev_dev 2 XXX >udd>m>tai>cwd_dev 3 >udd>m>tai ! string [wd a] >udd>m>tai>archive_dev >udd>m>tai>abbrev_dev >udd>m>tai>cwd_dev >udd>m>tai ----------------------------------------------------------- Historical Background This edition of the Multics software materials and documentation is provided and donated to Massachusetts Institute of Technology by Group BULL including BULL HN Information Systems Inc. as a contribution to computer science knowledge. This donation is made also to give evidence of the common contributions of Massachusetts Institute of Technology, Bell Laboratories, General Electric, Honeywell Information Systems Inc., Honeywell BULL Inc., Groupe BULL and BULL HN Information Systems Inc. to the development of this operating system. Multics development was initiated by Massachusetts Institute of Technology Project MAC (1963-1970), renamed the MIT Laboratory for Computer Science and Artificial Intelligence in the mid 1970s, under the leadership of Professor Fernando Jose Corbato. Users consider that Multics provided the best software architecture for managing computer hardware properly and for executing programs. Many subsequent operating systems incorporated Multics principles. Multics was distributed in 1975 to 2000 by Group Bull in Europe , and in the U.S. by Bull HN Information Systems Inc., as successor in interest by change in name only to Honeywell Bull Inc. and Honeywell Information Systems Inc. . ----------------------------------------------------------- Permission to use, copy, modify, and distribute these programs and their documentation for any purpose and without fee is hereby granted,provided that the below copyright notice and historical background appear in all copies and that both the copyright notice and historical background and this permission notice appear in supporting documentation, and that the names of MIT, HIS, BULL or BULL HN not be used in advertising or publicity pertaining to distribution of the programs without specific prior written permission. Copyright 1972 by Massachusetts Institute of Technology and Honeywell Information Systems Inc. Copyright 2006 by BULL HN Information Systems Inc. Copyright 2006 by Bull SAS All Rights Reserved