I'd like to run some different scripts simultanously using bash. All of them say something to an screen-session.
What we have:
worker=1
while [[ ! -f "worker$worker.sh" ]]; do
if [[ ! -f "worker$worker.sh" ]]; then
cat >worker$worker.sh <<EOL
#some code with variables which change and say something to an screen session#
EOL
chmod a+x worker$worker.sh
./worker$worker.sh
break
else
(( worker ++ ))
continue
fi
done
The current code does not work :/ What's wrong?