thunderbird -compose "attachment='$HOME/test test.txt'" works.
thunderbird -compose "attachment='$HOME/test, test.txt'" does not work and gives a file does not exist error message.
This must be because of the way Thunderbird handles command line arguments; e.g.,
thunderbird -compose "to='[email protected]',attachment='~/file.txt'"
The compose arguments are separated by , and that must be why having a , in the file name breaks things. I cannot, however, think of a way to "escape" commas in the file name.
Note:
- In Thunderbird 3+, using the protocol
file://is not required any more.
Both
thunderbird -compose "attachment='$HOME/test test.txt'"
and
thunderbird -compose "attachment='file://$HOME/test test.txt'"
work.
Neither
thunderbird -compose "attachment='$HOME/test, test.txt'"
nor
thunderbird -compose "attachment='file://$HOME/test, test.txt'"
works.
\,or url encode%2Cit.\,) does not work; it gives the samefile does not exist error. The characters,and%are both legitimate in the file name so I don't think URL encoding is an option becausetest,testandtest%2Ctestare both legitimate file names.test%2Ctestwould becometest%252Ctestwhen url encoded. It is worth trying it (it might need the explicitfile://prefix to work I suppose but I don't know).