I need to write a bash script to run a program and then every 5 seconds pass data to this program. The program accepts command line input and then will return some data. I currently have
./a &
while true
do
echo "input 1"
echo "input 2"
sleep 5
done
But this doesn't do what I'm after. The data being passed each time will be the same and the program cannot be restarted. How would I go about this? Thanks in advance.