My mac Automator Application script is not working with two arguments On my Catalina mac, I have this Mac Automator shell script to remove all metadata from image files as follows:

for f in "$@"
do
/usr/local/bin/exiftool -all= "$f"
done


Now this utility exiftool by default makes a backup of the original image file and it works OK. However, exiftool has another option "-overwrite_original" which can be added to the command line as follows:

exiftool -overwrite_original -all= filename


My problem is that when I add the other option (overwrite) to the Automator shell script above, the script just doesn't work. Is there any syntax problem that I need to fix?
From Terminal on macOS Catalina 10.15.1, exiftool -ver returns 11.78.

I used the ExifTool-11.78.dmg from https://exiftool.org to install it.

exiftool -all= filename does not make a backup, nor does exiftool -overwrite_original -all= filename; however, in both cases a filename_exiftool_tmp file is created during the process and I'm just left with filename when the process completes.



As an example, I take a screenshot of the Desktop and just use exiftool filename from Terminal and it prints out 90 lines of metadata.

Then I use Automator on it, then back in Terminal using exiftool filename it prints out 20 lines of metadata.

The metadata of the 20 lines left cannot be removed by exiftool.

I then run exiftool -all= filename from Terminal and it prints 0 image files updated and 1 image files unchanged.

This is exactly as it should be as some of the information is not being pulled from the file when queried by exiftool. 
Some of that info comes for the filesystem, attributes of the file and what info is shown that comes from within the file just cannot be removed by exiftool and I've actually read that somewhere within the documentation, whether it be at https://exiftool.org, or from where I just don't remember exactly where, sorry.