linuxshellshelinks

I want to open multiple elinks at regular interval of 6 seconds


I want to open multiple elinks at regular interval of 6 seconds

#!/bin/sh
for i in 1 2 
do

echo "Looping ... number $i";
elinks  'http://google.com' ; q ; sleep 6; elinks  'http://google.com'; q ; sleep 1800;

done

HOw do I quit 1st elink and open another one , Any command for that ? Manually q or ^C is working , but i want a shell script command

Thanks!!


Solution

  • You can quit elinks by killing it using killall elinks.

    Here is the final script:

    #!/bin/sh
    for i in 1 2 
    do
        echo "Looping ... number $i"
        elinks 'http://google.com' &
        sleep 6
        killall elinks
    
        elinks 'http://google.com' &
        sleep 1800
        killall elinks
    done