Renamed -version switch to -Version to remove the conflict with -verbose.
[mmh] / man / mhpath.man1
1 .\"
2 .\" %nmhwarning%
3 .\"
4 .TH MHPATH %manext1% "%nmhdate%" MH.6.8 [%nmhversion%]
5 .SH NAME
6 mhpath \- print full pathnames of nmh messages and folders
7 .SH SYNOPSIS
8 .HP 5
9 .na
10 .B mhpath
11 .RI [ +folder ]
12 .RI [ msgs ]
13 .RB [ \-Version ]
14 .RB [ \-help ]
15 .ad
16 .SH DESCRIPTION
17 .B mhpath
18 expands and sorts the message list `msgs' and writes the full
19 pathnames of the messages to the standard output separated by newlines.
20 If no `msgs' are specified,
21 .B mhpath
22 outputs the current mail folder's pathname
23 instead.  If the only argument is `+', your mail storage location
24 (\*(lqPath\*(rq) is output; this can be useful in shell scripts.
25 .PP
26 Contrasted with other
27 .B nmh
28 commands, a message argument to
29 .B mhpath
30 may often be intended for writing.  Because of this:
31 .PP
32 .IP 1) 4
33 the name \*(lqnew\*(rq has been added to
34 .BR mhpath 's
35 list of
36 reserved message names (the others are \*(lqfirst\*(rq, \*(lqlast\*(rq,
37 \*(lqprev\*(rq, \*(lqnext\*(rq, \*(lqcur\*(rq, and \*(lqall\*(rq).
38 The new message is equivalent to the message after the last message
39 in a folder (and equivalent to 1 in a folder without messages).
40 The \*(lqnew\*(rq message may not be used as part of a message range.
41 .IP 2) 4
42 Within a message list, the following designations may refer to messages
43 that do not exist: a single numeric message name, the single message name
44 \*(lqcur\*(rq, and (obviously) the single message name \*(lqnew\*(rq.
45 All other message designations must refer to at least one existing
46 message, if the folder contains messages.
47 .IP 3) 4
48 An empty folder is not in itself an error.
49 .PP
50 Message numbers greater than the highest existing message in a folder
51 as part of a range designation are replaced with the next free message
52 number.
53 .PP
54 Examples: The current folder foo contains messages 3 5 6.
55 Cur is 4.
56 .PP
57 .RS 5
58 .nf
59 % mhpath
60 /r/phyl/Mail/foo
61
62 % mhpath all
63 /r/phyl/Mail/foo/3
64 /r/phyl/Mail/foo/5
65 /r/phyl/Mail/foo/6
66
67 % mhpath 2001
68 /r/phyl/Mail/foo/7
69
70 % mhpath 1\-2001
71 /r/phyl/Mail/foo/3
72 /r/phyl/Mail/foo/5
73 /r/phyl/Mail/foo/6
74
75 % mhpath new
76 /r/phyl/Mail/foo/7
77
78 % mhpath last new
79 /r/phyl/Mail/foo/6
80 /r/phyl/Mail/foo/7
81
82 % mhpath last\-new
83 bad message list \*(lqlast\-new\*(rq.
84
85 % mhpath cur
86 /r/phyl/Mail/foo/4
87
88 % mhpath 1\-2
89 no messages in range \*(lq1\-2\*(rq.
90
91 % mhpath first:2
92 /r/phyl/Mail/foo/3
93 /r/phyl/Mail/foo/5
94
95 % mhpath 1 2
96 /r/phyl/Mail/foo/1
97 /r/phyl/Mail/foo/2
98 .fi
99 .RE
100 .PP
101 .B mhpath
102 is also useful in back\-quoted operations:
103 .PP
104 .RS 5
105 .nf
106 % cd `mhpath +inbox`
107
108 % echo `mhpath +`
109 /r/phyl/Mail
110 .fi
111 .RE
112 .PP
113
114 .SH FILES
115 .fc ^ ~
116 .nf
117 .ta \w'%etcdir%/ExtraBigFileName  'u
118 ^$HOME/.mmh/profile~^The user profile
119 .fi
120
121 .SH "PROFILE COMPONENTS"
122 .fc ^ ~
123 .nf
124 .ta 2.4i
125 .ta \w'ExtraBigProfileName  'u
126 ^Path:~^To determine the user's mail storage
127 ^Current\-Folder:~^To find the default current folder
128 .fi
129
130 .SH "SEE ALSO"
131 folder(1)
132
133 .SH DEFAULTS
134 .nf
135 .RB ` +folder "' defaults to the current folder"
136 .RB ` msgs "' defaults to none"
137 .fi
138
139 .SH CONTEXT
140 None
141
142 .SH BUGS
143 Like all
144 .B nmh
145 commands,
146 .B mhpath
147 expands and sorts
148 .RI [ msgs ].
149 So don't
150 expect
151 .PP
152 .RS 5
153 .nf
154 mv `mhpath 501 500`
155 .fi
156 .RE
157 .PP
158 to move 501 to 500.
159 Quite the reverse.  But
160 .PP
161 .RS 5
162 .nf
163 mv `mhpath 501` `mhpath 500`
164 .fi
165 .RE
166 .PP
167 will do the trick.
168 .PP
169 Out of range message 0 is treated far more severely than large out of
170 range message numbers.