Public bug reported:

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.

** Affects: mime-support (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: testcase

** Attachment added: "Bash script with testcases"
   
https://bugs.launchpad.net/bugs/1795907/+attachment/5196659/+files/test_test.sh

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1795907

Title:
  In tests %s is not substituted with filename

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/mime-support/+bug/1795907/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to