I don't know how to make mutt distinguish between pdf and word (doc)
documents. They both show up as octet stream. So, I am trying to put a test
command into my mailcap file to test which type of file is attached, doc or
pdf. I am not having much luck, so I think I need some help.

Here is my mailcap line for pdf:

application/octet-stream;/opt/Acrobat3/bin/acroread %s; 
test=/usr/local/bin/mutt-testpdf %s 

Here is my script to test for the pdf file:

echo "This is 0" $0  > /home/jlh/junk
echo "This is 1" $1  >> /home/jlh/junk
echo "This is all" $* >> /home/jlh/junk
i=`echo $0 | sed -n "/\.pdf$/p"`
[ -n "$i" ] && echo 0 || echo 1         

Now, I have found many difficulties.
First, %s never gets carried over into my script, which I test by looking at that junk 
file.
If I put a constant string in place of %s, then it shouws up as $1.
$0 shows the name of the command. I thought that sh -c makes the first argument $0, 
not $1.
Finally, if I  make my test script just echo a 1, acroread is still
invoked.
So, I am really confused. 
Any insight appreciated.
Joel



Reply via email to