Forum Moderators: phranque

Message Too Old, No Replies

What is SSH commands for this

         

basketmen

7:49 pm on Dec 20, 2015 (gmt 0)

10+ Year Member



I am using centos

Please help what is SSH commands to do this:

run a command 20 times, break 2 seconds, and repeated again

so like this
// run 20 times
wget http://test.com
wget http://test.com
wget http://test.com
wget http://test.com
wget http://test.com
wget http://test.com
wget http://test.com
wget http://test.com
wget http://test.com
wget http://test.com
wget http://test.com
wget http://test.com
wget http://test.com
wget http://test.com
wget http://test.com
wget http://test.com
wget http://test.com
wget http://test.com
wget http://test.com
wget http://test.com
//break 2 seconds

// run 20 times
wget http://test.com
wget http://test.com
wget http://test.com
wget http://test.com
wget http://test.com
wget http://test.com
wget http://test.com
wget http://test.com
wget http://test.com
wget http://test.com
wget http://test.com
wget http://test.com
wget http://test.com
wget http://test.com
wget http://test.com
wget http://test.com
wget http://test.com
wget http://test.com
wget http://test.com
wget http://test.com
//break 2 seconds

and loop run it automatically, until i clik ctrl+c to stop it manually




will give rep +1 for all answered

tangor

3:19 am on Dec 22, 2015 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Suggest a bit more study on ssh and loop command. Might start here:

[siteground.com...]

LiveChatAdam

2:16 pm on Jan 26, 2016 (gmt 0)



Hi, try this:

a. create an empty file and call it something.sh

b. paste this into the file:

#!/bin/bash
while :
do
for i in {1..20}
do
wget http://example.com
done
sleep 2;
done

c. cake the created file executable in terminal:
chmod +x something.sh

d. run it:
./something.sh

Cheers
Adam

[edited by: bill at 12:31 am (utc) on Jan 27, 2016]
[edit reason] use EXAMPLE.COM to prevent auto-linking [/edit]