You are erroneously escaping the shell variables on line 61 of your script:

cat $1 | $MAKEMIME -c \"$TYPE\" -e \"$ENCODING\" -

Change it to this:

cat $1 | $MAKEMIME -c "$TYPE" -e "$ENCODING" -

and it should work (or at least, it did for me).

Cheers

Andrew

Stroller wrote:
I start to write a little shell script as a wrapper.

I've spent a little time making sure each part works ok... piping text-files into sendmail, and renaming the original file after the time&date when the script has finished. But when I get to the actual piping of a file into `makemime` it falls over. Now this is really weird, because I can do it from the commandline fine, but not it seems as part of a shell script.

At the commandline:
   $ cat foo.wav | makemime -c "audio/x-wav" -e "base64" -
   Content-Type: audio/x-wav
   Content-Transfer-Encoding: base64

UklGRqaKAQBXQVZFZm10IBAAAAABAAEAIBwAACAcAAABAAgAZGF0YYGKAQCAf39/f39/ gICAgICA
gICAgIB/f39/f39/f4CAgICAgICAf39/fn5+fn9/gICAgYGBgYGAgH9/f39/ f3+AgICAgICAgH9/
...


I've attached my script. I'm guessing that someone out there will find it laughably easy to explain why this isn't working for me, but I'm absolutely baffled. If I run this script the result of the 2nd-last (uncommented) line indicates that I am trying the very same commands & variables as I've shown above, and if I copy & paste that line back into my terminal, it works fine. But when I run the script I `makemime` always fails with its usage message:
Usage:
makemime -c type [-o file] [-e encoding] [-C charset] [-N name] \
[-a "Header: Contents"] file ...


I'm extremely indebted for any clarification,

Stroller.

-- [EMAIL PROTECTED] mailing list



Reply via email to