In tests %s is not substituted with filename
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mime-support (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
The manual of mailcap(5) says that in the test field "The command may be any UNIX command, using the same syntax and the same %-escapes as for the viewing command"
So this mailcap entry should be fine:
text/plain; wc '%s'; test=grep -q somepattern %s
I would expect to whenever there's a plain text file that contains the word somepattern, wc should be invoked by run-mailcap on it. Otherwise this entry should not be considered by run-mailcap.
What actually happens is that the %s will be substituted for the view field (wc '%s') but not for the test field and so this entry will be never considered.
I've included a bash script with testcases to demonstrate the bug. (Please keep in mind that after all the years I still do consider myself a bash script novice)
I have no patch. I do not grok perl.