I have the folowing script.
#!/usr/bin/env bash
target="anotherfolder";
dest="somefolder";
find $dest -maxdepth 1 -type f | sort -r | while IFS= read -r file; do
while /bin/true; do
files=$(ls -a "$dest" | grep -Fxv "$ignore")
if [ "$files" ];
then
php "$files" | nc 10.x.x.x 9100
mv "$files" "$dest"
break
fi
done
done
When i run the script is working only with the first file, after that is stop. I assume i have to add an exit code after
php "$files" | nc 10.x.x.x 9100
Can you help ?