On Mac, a post-processing action has to be a proper OS X application, not an executable or shell script. You can make such an application from your shell script using Applescript -- make a droplet that responds to files being dropped on it via the "on open" handler. See here for a few more details: Re: Help!! Export Post process action does not fire!
Alternatively, you can buy the Run Any Command plugin, which lets you run a shell command line as an export post-processing action.
On Windows, it's a lot simpler -- the post-processing action just runs an executable with a command line.
When did Adobe remove support for shell scripts in export post-processing and why did they remove it?
I gave you absolutely the wrong answer. I repeated a misremembered factoid without checking, which I discovered when I went to investigate the behavior of previous versions. Very sorry for that -- I hate it when others do this, and I hate it more when I do.
I just tried this sample script action.sh as an export action, and it worked just fine after marking it executable with "chmod":
#!/bin/sh (date; echo $1 $2; echo $PATH) >> /users/john/desktop/action.txt
It produced this output:
Wed Jul 5 13:28:22 PDT 2017 /Users/john/Desktop/06-09-2012_SFA_SC_TWT_I00010001.tif /usr/bin:/bin:/usr/sbin:/sbin
The last line points to the likely cause of the problem. On my system, the default location that ExifTool installs itself is /usr/local/bin, which isn't on the value of PATH used by LR:
Johns-MacBook-Pro-3:Desktop john$ which exiftool /usr/local/bin/exiftool
So your scripts could either add the location of "exiftool" to PATH or they could just use a fully qualified pathname, e.g.
#!/bin/sh (date; echo $1 $2; echo $PATH; /usr/local/bin/exiftool -ver) \ >> /users/john/desktop/action.txt
which works correctly.
That was the problem. Thank you very much.
I thought it might be PATH related but a) I couldn't think why Lightroom would be using a different PATH from what I got by default in Terminal and b) couldn't think of a way of checking the PATH that Lightroom used in the Export action.