> > I have thought about this. There are time where one really wants to
> > know THE current folder, which means none if there is none.
>
> But there *is* a current folder if there isn't one in context, and
> it's +inbox.
>
> Why don't you use mhparam instead?
>
> [EMAIL PROTECTED]:878]$ mhparam Current-Folder
> [EMAIL PROTECTED]:879]$ echo $?
> 1
> [EMAIL PROTECTED]:880]$ folder +lists
> lists+ has no messages ; (others).
> [EMAIL PROTECTED]:881]$ mhparam Current-Folder
> lists
> [EMAIL PROTECTED]:882]$ echo $?
> 0
There is only a current folder from the nmh perspective, not from the
perspective of another program trying to access something in the nmh
directory structure.
What you have above doesn't quite do the trick. I guess that I will
agree with you that this can be done without a change to mhpath though.
folder_name=`mhparam Current-Folder`
if [ $? -ne 0 ]; then
echo "No current folder."
else
folder_path=`mhpath +$folder_name`
if [ -d "$folder_path" ]; then
echo "Current folder is $folder_name."
else
echo "No current folder."
fi
fi
Pretty cumbersome. Takes more code that the change to mhpath would
take.
Jon
_______________________________________________
Nmh-workers mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/nmh-workers