backslash in terminal

Started by GoGongyi, June 07, 2018, 09:52:52 PM

Previous topic - Next topic

GoGongyi

Hi, I'm new to exiftool and it's exciting to learn about it.   I'm running terminal on my mac and I see in one of the posts from Phil he typed:

exiftool -P -d '%Y-%m-%d %H.%M.%S' \
    '-filename<${CreateDate}_${Model;}.%e' \
    '-filename<${DateTimeOriginal}_${Make;}.%e' \
    '-filename<${DateTimeOriginal}_${Make;}_${Model;}.%e' \
    $@

My questions are:
1. how are you able to type in the terminal on multiple lines?   I hit enter and it executes, so how are you able to move the cursor to the next line without executing?
2. does the backslash \ mean something here?
3. what does $@ mean at the end?

Thanks so much!

GoGongyi

Phil Harvey

The unix shells use "\" at the end of the line as a continuation on the next line.

The $@ is used in a shell script to represent the command-line arguments passed to the script.

These are features of the particular shell you are using, and not specific to Exiftool.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).