0

Here's my loop:

#!/bin/bash
count=3

for i in $(seq $count)
do
   echo $i
   killall midori
   midori http://www.test.com/test.html?id=$i &
done

But it won't kill midori and launch another one in the background to continue the loop. Any ideas?

1 Answer 1

3

It most likely works exactly as you want it to, except you're killing midori within a millisecond of starting it, before it gets a chance to open a window or anything.

Try adding a sleep to give it a chance to start up and do something before you kill it:

#!/bin/bash
count=3

for i in $(seq $count)
do
   echo $i
   killall midori
   midori http://www.test.com/test.html?id=$i &
   sleep 10
done
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.