Привет, я новичок в программировании Bash и мне нужна помощь.Я строю конвейер для обработки изображений.Я хотел бы иметь возможность взять изображения PNG в папке и передать их в clusterImage.pl, как только это будет сделано. Я хотел бы затем передать полученный файл в seperateObjects.pl полученный файл с тем же именем, но имеет kmeansOutput.all.matrix прикреплен к концу.Ниже то, что у меня есть, но оно не работает.Любая помощь будет принята с благодарностью.Спасибо
#!/bin/bash
#This script will take in an image and a matrix file.
#The output will be an image and a matrix file.
list=`ls *.png`
for i in $list
do
$file="./$list"
$image_array = $list
echo $file
#Cheching to see if the file exists.
for((j=0;j<=i;j++))
do
if [ -e image_array[j] ]; then
echo $file
echo "Begining processing"
#Take in an image and create a matrix from it.
perl clusterImage.pl SampleImage.png
#Take in a matrix and draw a picture showing the centers of all
#of the colonies.
perl seperateObjects.pl SampleImage.png.kmeansOutput.all.matrix
echo "Ending processing"
else
echo "There is an issue"
fi
done
done