I'm using ubuntu 11.04 and im trying to write a bash script that opens urls from a file each in a new tab with a sleep of 15 or so seconds, the file is 198 lines long and there is one url on each line. i have two potential methods of doing this
method one
while read line; do
firefox -new-tab "$line"
sleep 15
done < file
method two
for line in $(cat file); do
firefox -new-tab "$line"
sleep 15
done
now both methods seem to give the same result, it opens firefox with the url of the first line and doesn't open any of the other urls until i close the browser, in which case it then opens up firefox with the url on the second line etc...
i have had some success with method one when i remove the sleep command it will try to open all of the urls at once in different tabs
i got the code for method one from: https://unix.stackexchange.com/questions/17659/opening-multiple-urls-from-a-text-file-as-different-tabs-in-firefox-chrome
and i got the code for method two from: http://whileonefork.blogspot.com/2011/02/bash-for-each-line-1-liners.html