Main Menu

bash and zsh

Started by jhbennett, August 25, 2022, 11:19:06 AM

Previous topic - Next topic

jhbennett

Hello
Simply trying 
exiftool -s1 -sort -G -*date* <FILENAME>

it works with bash

it doesn't work with zsh

Any solutions? as MACOS (Monterey) suggests I use zsh instead of bash...

Thanks

StarGeek

Put the asterisks in quotes.  In some linux shells (I thought all, but apparently not), the an asterisk without quotes is file globbing and those asterisks are being replaced by file names.

I would also suggest using -Time:All, as not all time related tags have date in the name

exiftool -s1 -sort -G -Time:All /path/to/files/

Edit: Found an ELI5 post on file globbing
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Alan Clifford

I haven't moved to zsh.

And my shell scripts have #!/bin/bash at the top.

jhbennett

Thanks for your help. Not used to a command-line system within a command-line system! A spattering of quotes is obviously the answer to trick either the shell (or the program exiftool) into understanding each other. Globbing is my new saviour...
BTW - I like -Time:All. Are there any other really useful "pseudo" Tags that I should be aware of that are very handy when searching or filtering photo metadata?

StarGeek

Time is a Group 2 name.  Group 2 names consist of
Audio
Author
Camera
Device
Document
ExifTool
Image
Location
Other
Preview
Printing
Time
Unknown
Video

The full list can be found under the GetAllGroups function or by using the -listg option.  In this case it would be -listg2.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

jhbennett

Thanks for the help and references. I think I'm on the right path now with all the information provided by you and this forum.
I am now ignoring switching between bash and zsh... I'll stick with zsh and try to work around its slight differences, even though most scripts in tutorials and examples seem to be bash oriented. After all, it's only "exec bash" in the Mac terminal to get the bash shell running again!