I don't know, but since CALIBRE_TEMP_DIR was never exported

(holdover I didn't notice) that wouldn't affect anything.
bash scripts don't default to exiting on the first error either.
I fixed the brokem tempdir problem, in case you want to try my latest anyway.

It also now writes a configuration file containing the settings. Do you think it is easier to see what settings there are now?