Re: Spaces in attached file names
On Wed, Mar 09, 2005 at 12:31:13AM +0100, Thomas Roessler wrote:
> Well, you could also set the mailcap_sanitize option in mutt. That
> should avoid all your problems, I think.
No, setting mailcap_sanitize="no" didn't change anything.
Oh, wait! It's a shell problem.
$ file /usr/bin/xpdf
/usr/bin/xpdf: Bourne-Again shell script text executable
Well, then. Seems like that script is the one that isn't doing the
right thing.
exec -a xpdf xpdf.bin "$@"
Now I'm not clear what's happening here.
If I setup something to show the arguments passed:
(/etc/mailcap)
application/pdf; /home/moseley/log.pl '%s'
and a simple perl script:
$ cat log.pl
#!/usr/bin/perl -w
use strict;
open FH, '>>/home/moseley/logger.out' or die $!;
print FH time, "[$$]:", join '::', @ARGV;
print FH "\n";
Then I expected to see mutt send multiple paramaters:
./log.pl hello there
1110326799[305]:hello::there # what I expect
run-mailcap 'test doc.pdf'
1110326851[325]:test doc.pdf # what I expect
And then regardless of "mailcap_sanitize" and regardless of %s
with or without quotes, running from mutt works just fine:
1110326951[398]:test doc.pdf
1110327011[421]:test doc.pdf
But, if I change /usr/bin/xpdf to also log the parameters
(and reset mailcap to application/pdf; /usr/bin/xpdf '%s'):
$ cat /usr/bin/xpdf
LANG=C
LC_ALL=C
export LANG LC_ALL
/home/moseley/log.pl "$@"
exec -a xpdf xpdf.bin "$@"
Then I see that the parameter is indeed split.
1110327660[648]:test::doc.pdf
But, Im not clear why "xpdf 'test doc.pdf'" works.
--
Bill Moseley
moseley@xxxxxxxx