KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a bash script to test how a server performs under load. num=1 if [ $# -gt 0 ]; then num=$1 fi for i in {1 .. $num}; do (while true; do { time curl --silent 'http://localhost'; } 2>&1 | grep real done) & done wait When I hit Ctrl-C, the main process exits, but the background loops keep running. How do I make them all exit? Or is there a better way of spawning a configurable number of logic loops executing in parallel?
Tags (comma-separated)
Save Edits
Cancel