0

I am trying to use the shell to loop sequentially through images in one folder and compare with the latest image in another folder.

One error i'm getting is -

zsh: no matches found: /TiffOut/*.tiff(.om[1])

Though I wouldn't be surprised if thats not the only problem.

What I'm hoping to acheive is:

  • Loop through all source images in current directory:
  • Put most recent file from TiffOut subdirectory in variable 'latest'
  • Compare current source, and latest output with '-evaluate-sequence max' to create new tiff with the brightest parts from each image_file
  • Save to TiffOut subdirectory

Heres my full script -

#! /bin/zsh -
filelist=$(ls | grep '.tiff')
for image_file in $filelist
do
latest=$(/TiffOut/*.tiff(.om[1]))
magick $image_file $latest -evaluate-sequence Max '/TiffOut/out_${imagefile}.tiff'
done

Thanks for reading

2
  • 1
    Please edit your question and explain what you think your script is doing because it isn't very clear. You're right that there are errors in the script, but we need to know what you expect it to do in order to help you get it right. Commented Feb 3, 2021 at 14:01
  • Thanks for the comment. I've added some info Commented Feb 3, 2021 at 14:19

1 Answer 1

0

You need to remote the leading / from /TiffOut/.

  • TiffOut/ is a relative path referring to a subdir of the present working dir, but
  • /TiffOut/ is an absolute path referring to a subdir of /, which is the root of the dir hierarchy.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.