Exiftool - how to add author tag based on the folder name the pdf is residing in
<p>Trying to write a script that would make exiftool write the result of </p>

<pre><code>echo "${PWD##*/}"
</code></pre>

<p>to the author metadata tag.</p>

<p>Let's say the pdf is located in /ResearchJournal/Research1/manual1.pdf</p>

<p>I want to use exiftool to append Research1 as the author of manual1.pdf.</p>

<p>When I'm in the /ResearchJournal/Research1 folder, I type <code>echo "${PWD##*/}"</code> in the terminal and I get the result <code>Research1</code>.</p>

<p>However I don't know how to write the exiftool command correctly.  </p>

<p>I know you can use <code>exiftool -author=Research1</code>, but I want to write the command so that I can just use it on a number of different folders without having to hard code the actual folder name each time.  </p>