I'm creating a sh script on my raspberry for a timelapse. I've included in the script 4 command that will successively take place, each command tested and working. Now my question is: how to come back to the first command after the last one, indefinitely?
#!/bin/bash
sudo raspistill -w 1024 -h 768 -o /home/pi/timelapse/a%04d.jpg -t 600000 -tl 30000
sudo kill $(ps ax | grep 'timelapse' | awk '{print $1}')
sudo avconv -r 10 -i /home/pi/timelapse/a%04d.jpg -r 10 -vcodec libx264 -crf 20 -g 15 timelaps$
sudo rm /home/pi/timelapse/*.jpg
So after sudo rm /home/pi/timelapse/*.jpg I want to go back to the first command.
Would you have any idea?
thanks.
yesorwhilebut that would be an infinite loop, what is the purpose of all this?greptoawk.awk '/timelapse/{print $1}is the same asgrep timelapse | ...sudo, it's probably simpler to just run the script itself withsudo.-oon grep is far easier than acquiring the same output in awk