I am trying to create a while loop that will print "." while a shell script process is running and stop printing when the process has finished. My code continues to print "." after launch.sh has completed.
sh launch.sh & PIDIOS=$!
dot_function() {
running=$(ps aux | grep launch.sh | wc -l)
while [ $running -ge 1 ]; do
if [ $running -lt 1 ]; then
break
elif [ $running -ge 1 ];
printf "."
sleep 1
fi
done
}
dot_function & PIDMIX=$
runningvariable in your loop.