i tried to run it and it doesnt work.
How do you know that it doesn't work?
Can you also explain what it is doing??
Loop through each JPG file located in the directory dir
If a JPG file's size is equal to 40318 bytes, then print the corresponding filename and the said size to results.csv
[...] I dont understand the
(($(wc -c < "$f") == 40318));
This is the part where you check whether the size of the file being processed is equal to 40318 bytes.
I would imagine like other code
would be the equal than.
means equal to.
Dont I still need to declare f??
is the file being processed in the loop.
It'll take each filename as its value, one by one.
Try this line in your shell if you don't get it yet:
for w in word1 word2; do echo "$w"; done