c4928b4a7de4c62c61deea9effe582b152180216
[mmh] / man / mhpath.man
1 .TH MHPATH %manext1% "February 18, 2012" "%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 .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
24 .B nmh
25 \*(lqPath\*(rq is output; this can be useful in shell scripts.
26 .PP
27 Contrasted 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 .PP
33 .IP 1) 4
34 the name \*(lqnew\*(rq has been added to
35 .BR mhpath 's
36 list of
37 reserved message names (the others are \*(lqfirst\*(rq, \*(lqlast\*(rq,
38 \*(lqprev\*(rq, \*(lqnext\*(rq, \*(lqcur\*(rq, and \*(lqall\*(rq).
39 The new message is equivalent to the message after the last message
40 in a folder (and equivalent to 1 in a folder without messages).
41 The \*(lqnew\*(rq message may not be used as part of a message range.
42 .IP 2) 4
43 Within a message list, the following designations may refer to messages
44 that do not exist: a single numeric message name, the single message name
45 \*(lqcur\*(rq, and (obviously) the single message name \*(lqnew\*(rq.
46 All other message designations must refer to at least one existing
47 message, if the folder contains messages.
48 .IP 3) 4
49 An empty folder is not in itself an error.
50 .PP
51 A message number less than that of the smallest existing message in a
52 folder is treated as if the message already exists.  A message number
53 greater than that of the highest existing message in a folder causes
54 an \*(lqout of range\*(rq error message to be displayed.
55 .PP
56 As part of a range designation that contains messages that do exist,
57 message numbers less than the smallest, or greater than the highest,
58 existing message in a folder are ignored.
59 .PP
60 Examples: The current folder foo contains messages 3 5 6.
61 Cur is 4.
62 .PP
63 .RS 5
64 .nf
65 % mhpath
66 /r/phyl/Mail/foo
67
68 % mhpath all
69 /r/phyl/Mail/foo/3
70 /r/phyl/Mail/foo/5
71 /r/phyl/Mail/foo/6
72
73 % mhpath 2001
74 mhpath: message 2001 out of range 1-6
75
76 % mhpath 1\-2001
77 /r/phyl/Mail/foo/3
78 /r/phyl/Mail/foo/5
79 /r/phyl/Mail/foo/6
80
81 % mhpath new
82 /r/phyl/Mail/foo/7
83
84 % mhpath last new
85 /r/phyl/Mail/foo/6
86 /r/phyl/Mail/foo/7
87
88 % mhpath last\-new
89 mhpath: bad message list last\-new
90
91 % mhpath cur
92 /r/phyl/Mail/foo/4
93
94 % mhpath 1\-2
95 mhpath: no messages in range 1\-2
96
97 % mhpath first:2
98 /r/phyl/Mail/foo/3
99 /r/phyl/Mail/foo/5
100
101 % mhpath 1 2
102 /r/phyl/Mail/foo/1
103 /r/phyl/Mail/foo/2
104 .fi
105 .RE
106 .PP
107 .B mhpath
108 is also useful in back\-quoted operations:
109 .PP
110 .RS 5
111 .nf
112 % cd `mhpath +inbox`
113
114 % echo `mhpath +`
115 /r/phyl/Mail
116 .fi
117 .RE
118 .SH FILES
119 .fc ^ ~
120 .nf
121 .ta \w'%etcdir%/ExtraBigFileName  'u
122 ^$HOME/\&.mh\(ruprofile~^The user profile
123 .fi
124 .SH "PROFILE COMPONENTS"
125 .fc ^ ~
126 .nf
127 .ta 2.4i
128 .ta \w'ExtraBigProfileName  'u
129 ^Path:~^To determine the user's nmh directory
130 ^Current\-Folder:~^To find the default current folder
131 .fi
132 .SH "SEE ALSO"
133 .IR folder (1)
134 .SH DEFAULTS
135 .nf
136 .RB ` +folder "' defaults to the current folder"
137 .RB ` msgs "' defaults to none"
138 .fi
139 .SH CONTEXT
140 None
141 .SH BUGS
142 Like all
143 .B nmh
144 commands,
145 .B mhpath
146 expands and sorts
147 .RI [ msgs ].
148 So don't
149 expect
150 .PP
151 .RS 5
152 .nf
153 mv `mhpath 501 500`
154 .fi
155 .RE
156 .PP
157 to move 501 to 500.
158 Quite the reverse.  But
159 .PP
160 .RS 5
161 .nf
162 mv `mhpath 501` `mhpath 500`
163 .fi
164 .RE
165 .PP
166 will do the trick.
167 .PP
168 Out of range message 0 is treated far more severely than large out of
169 range message numbers.