I'm writing a script which will simulate multiple users connecting to my webserver (and remaining connected, hence the use of lynx and not curl). I can specify a number of hits but lynx flags up as a foreground process which I then need to exit out of for the next 'hit' to get processed. I guess what I need is for lynx to connect to a page, then get sent to the background and then another lynx 'hit' is formed. Code below:
Code:
URL=www.myserver.com
echo -n "specify number of hits: "
read TIMES
function hitit {
for i in $(seq 1 $TIMES); do
{
lynx -accept_all_cookies "$URL" > /dev/null 2>/dev/null &
};
done
}
hitit
I'm a little new to the background process concep, perhaps someone could help