1 01/02/90 working_dir, wd, print_wdir, pwd
2
3 Syntax as a command: wd LOCATIONS -control_arg
4
5
6 Syntax as an active function: wd LOCATIONS
7
8
9 Function: prints or returns the pathname of the current working
10 directory. Optional arguments can be given to print or return
11 entries on the stack of working directories. Refer to the
12 change_wdir command for a description of the working directory
13 stack.
14
15
16 Arguments:
17 LOCATIONS
18 select entries on the working directory stack to be printed
19 or returned. LOCATION can be an integer position N from the
20 top of the stack; or a text LABEL associated with a stack
21 entry; or one of the reserved words first f, last l or
22 all a. The reserved word first identifies the current
23 working directory which is not on the stack of prior working
24 directories and is displayed above stack position 1; last
25 identifies the bottom stack entry; and all identifies the
26 current working directory plus all stacked directories.
27
28
29 More than one LOCATION can be given to select several entries.
30 Individual locations are separated by a space. A LOCATION_RANGE
31 is given by a starting and ending LOCATION separated by a colon.
32 For example, f:2 identifies the current working directory and
33 the top two directories on the stack, and 1:XXX identifies stack
34 entries from the top of the stack to the entry with label XXX.
35
36
37 Control arguments:
38 -header, -he
39 displays a heading of the form: LOC LABEL PATHNAME . The default
40 is to print a heading when more than one directory is displayed.
41 -no_header, -nhe
42 suppresses the heading before the stack contents are displayed.
43 default
44
45
46 Notes: Since the working_dir is returned in quotes, the command
47 processor treats it as a single argument regardless of special
48 characters in the name.
49
50 The current working directory is located at location zero. The most
51 recent prior working directory is at the stack position 1 and the
52 least recent prior working directory is at the Nth last position.
53 If a stack of prior working directories is empty then only the current
54 working directory is printed. For the case when the current working
55 directory has been deleted, an attempt to print it out will display
56 the "directory has been deleted" message in square brackets,
57 separated from the directory pathname by a blank space. This does not
58 apply when one or more prior working directories on the stack have
59 been deleted. See also the change_wdir cwd command for stack
60 features.
61
62
63 Examples: Assume the stack looks like the following:
64
65 0 >udd>m>tai>archive_dev
66 1 >udd>m>tai>abbrev_dev
67 2 XXX >udd>m>tai>cwd_dev
68 3 >udd>m>tai
69
70 then
71
72 ! wd XXX
73 2 XXX >udd>m>tai>cwd_dev
74
75
76 ! wd 2 -he
77 LOC LABEL PATHNAME
78
79 2 XXX >udd>m>tai>cwd_dev
80
81 ! wd f:XXX
82 LOC LABEL PATHNAME
83
84 0 >udd>m>tai>archive_dev
85 1 >udd>m>tai>abbrev_dev
86 2 XXX >udd>m>tai>cwd_dev
87
88 ! string wd XXX
89 >udd>m>tai>cwd_dev
90
91
92 ! string wd 2
93 >udd>m>tai>cwd_dev
94
95
96 ! string wd a
97 >udd>m>tai>archive_dev >udd>m>tai>abbrev_dev >udd>m>tai>cwd_dev >udd>m>tai
98
99 ! dd >udd>m>tai>archive_dev
100 ! wd a
101 LOC LABEL PATHNAME
102
103
104 0 >udd>m>tai>archive_dev directory has been deleted
105 1 >udd>m>tai>abbrev_dev
106 2 XXX >udd>m>tai>cwd_dev
107 3 >udd>m>tai
108
109 ! string wd a
110 >udd>m>tai>archive_dev >udd>m>tai>abbrev_dev >udd>m>tai>cwd_dev >udd>m>tai
111