bash

Run command in a loop endlessly

while :; do sleep 5; echo "Hello"; done

Run command a set number of times

for i in {1..10}; do sleep 5; done

Another way, this time pushing the output to a file and then sorting/inspecting the output.

for i in $(seq 1 100); do echo "$(date; sleep 1)"; done > output; cat output | sort | uniq -c

Write HTTP request into unix socket in a loop

for _ in {1..100}
do
    printf "GET / HTTP/1.1\r\nConnection: close\r\n"
done

| nc -U /path/to/socket.sock