The mhpath Command
[previous]
[next]
[table of contents] [index]
Because users can change their MH directory structures completely,
your shell programs shouldn't assume anything about the locations of
folders or the names of their MH directories.
Instead, use mhpath to get this information.
Here are some examples:
$ folder
inbox+ has 23 messages ( 2- 47); cur= 15.
$ mhpath
/u/ehuser/Mail/inbox
$ mhpath last:2
/u/ehuser/Mail/inbox/46 /u/ehuser/Mail/inbox/47
$ mhpath new
/u/ehuser/Mail/inbox/48
$ mhpath +somefolder
/u/ehuser/Mail/somefolder
$ mhpath +
/u/ehuser/Mail
$ folder
inbox+ has 23 messages ( 2- 47); cur= 15.
With no arguments, mhpath gives the full pathname of your current folder.
If you give message numbers, sequences, or ranges, you'll get the
full pathname of each message.
The special argument new gives you the pathname that a new message
in the folder would have -- useful if you're creating a new message.
If you give a folder name, mhpath gives the full pathname of that
folder but it doesn't change the current folder.
The folder doesn't have to exist yet unless you want the paths of
messages in the folder.
Finally, an argument of just a plus sign (+) gives the path
of the MH directory itself.
You'll almost always use mhpath with command substitution
(the backquotes).
For efficiency, you can run mhpath once at the start of the
shell script to grab things like the location of the user's MH directory
and store that information in a shell variable.
|