9

I am trying to save camera make to a var in my bash script. If I use:

exiftool -make x.jpg

This returns:

MAKE : SAMSUNG

I need it to return just the value, without the key and colon. What am I doing wrong?

16

From the man page:

   -s (-short)
        Short output format.  Prints tag names instead of descriptions.
        Add up to 3 -s options for even shorter formats:

            -s        - print tag names instead of descriptions
            -s -s     - no extra spaces to column-align values
            -s -s -s  - print values only

so,

exiftool -s -s -s -make x.jpg

and there you are.

  • exiftool -s -S -make x.jpg will also work. – saurabheights Jul 6 '16 at 9:53
4

Use -b:

$ exiftool -b -make x.jpg

From the man page:

-b (-binary)

Output requested metadata in binary format without tag names or descriptions. This option is mainly used for extracting embedded images or other binary data, but it may also be useful for some text strings since control characters (such as newlines) are not replaced by '.' as they are in the default output. List items are separated by a newline when extracted with the -b option. May be combined with "-j", "-php" or "-X" to extract binary data in JSON, PHP or XML format.

Highlight mine; it does what it says on the tin!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.