]> diplodocus.org Git - nmh/blob - man/mhpath.man
new.c: Order two return statements to match comment.
[nmh] / man / mhpath.man
1 .TH MHPATH %manext1% 2012-02-18 "%nmhversion%"
2 .
3 .\" %nmhwarning%
4 .
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 .RB [ \-help ]
12 .RB [ \-version ]
13 .RI [ +folder ]
14 .RI [ msgs ]
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 instead.
23 If the only argument is `+', your
24 .B nmh
25 \*(lqPath\*(rq is output; this can be useful in shell scripts.
26 .PP
27 In contrast with other
28 .B nmh
29 commands, a message argument to
30 .B mhpath
31 may often be intended for writing. Because of this:
32 .IP 1) 4
33 the name \*(lqnew\*(rq has been added to
34 .BR mhpath 's
35 list of reserved message names (the others are \*(lqfirst\*(rq,
36 \*(lqlast\*(rq, \*(lqprev\*(rq, \*(lqnext\*(rq, \*(lqcur\*(rq,
37 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 A message number less than that of the smallest existing message in a
51 folder is treated as if the message already exists. A message number
52 greater than that of the highest existing message in a folder causes
53 an \*(lqout of range\*(rq error message to be displayed.
54 .PP
55 As part of a range designation that contains messages that do exist,
56 message numbers less than the smallest, or greater than the highest,
57 existing message in a folder are ignored.
58 .PP
59 Examples: The current folder foo contains messages 3 5 6.
60 Cur is 4.
61 .PP
62 .RS 5
63 .nf
64 % mhpath
65 /r/phyl/Mail/foo
66
67 % mhpath all
68 /r/phyl/Mail/foo/3
69 /r/phyl/Mail/foo/5
70 /r/phyl/Mail/foo/6
71
72 % mhpath 2001
73 mhpath: message 2001 out of range 1-6
74
75 % mhpath 1\-2001
76 /r/phyl/Mail/foo/3
77 /r/phyl/Mail/foo/5
78 /r/phyl/Mail/foo/6
79
80 % mhpath new
81 /r/phyl/Mail/foo/7
82
83 % mhpath last new
84 /r/phyl/Mail/foo/6
85 /r/phyl/Mail/foo/7
86
87 % mhpath last\-new
88 mhpath: bad message list last\-new
89
90 % mhpath cur
91 /r/phyl/Mail/foo/4
92
93 % mhpath 1\-2
94 mhpath: no messages in range 1\-2
95
96 % mhpath first:2
97 /r/phyl/Mail/foo/3
98 /r/phyl/Mail/foo/5
99
100 % mhpath 1 2
101 /r/phyl/Mail/foo/1
102 /r/phyl/Mail/foo/2
103 .fi
104 .RE
105 .PP
106 .B mhpath
107 is also useful in backquoted operations:
108 .PP
109 .RS 5
110 .nf
111 % cd `mhpath +inbox`
112
113 % echo `mhpath +`
114 /r/phyl/Mail
115 .fi
116 .RE
117 .PP
118 Because
119 .B mhpath
120 expands and sorts
121 .RI [ msgs ].
122 the command
123 .PP
124 .RS 5
125 .nf
126 mv `mhpath 501 500`
127 .fi
128 .RE
129 .PP
130 to will not move 501 to 500; quite the reverse. But
131 .PP
132 .RS 5
133 .nf
134 mv `mhpath 501` `mhpath 500`
135 .fi
136 .RE
137 .PP
138 will do the trick.
139 .PP
140 Out-of-range message 0 produces a different error message than large
141 out-of-range message numbers. But both cause
142 .B mhpath
143 to exit with non-zero status.
144 .SH FILES
145 .fc ^ ~
146 .nf
147 .ta \w'ExtraBigProfileName 'u
148 ^$HOME/.mh_profile~^The user profile
149 .fi
150 .SH "PROFILE COMPONENTS"
151 .fc ^ ~
152 .nf
153 .ta 2.4i
154 .ta \w'ExtraBigProfileName 'u
155 ^Path:~^To determine the user's nmh directory
156 ^Current\-Folder:~^To find the default current folder
157 .fi
158 .SH "SEE ALSO"
159 .IR folder (1)
160 .SH DEFAULTS
161 .nf
162 .RB ` +folder "' defaults to the current folder"
163 .RB ` msgs "' defaults to none"
164 .fi
165 .SH CONTEXT
166 None