Reputation: 944
I am trying to write a bash script that will execute 1 Linux command (exiftool
) for each file in a certain folder in a for loop.
Example of how to run this comand: exiftool /Users/user1/Documents/recovered/recup_dir.4/file_1.jpeg
Here is what I managed to do:
for i in /Users/user1/Documents/recovered/recup_dir.4
do
exiftool i
done
The error I got is:
File not found: i.
What I am doing wrong?
Upvotes: 0
Views: 60
Reputation: 47169
You could likely use the find
command to do this:
find /path/ -type f -maxdepth 1 -exec exiftool {} \;
Upvotes: 1
Reputation: 88654
Try this:
for i in /Users/user1/Documents/recovered/recup_dir.4/*
do
exiftool "$i"
done
Upvotes: 2