illphated
run_parallel_loop.sh
3X IN A ROW 1 by 1
#!/bin/bash
# Replace this with your actual command
COMMAND=”echo Running your command”
# Repeat 99 times
for i in {1..99}
do
echo “Round $i…”
# Run 3 commands in parallel
$COMMAND &
$COMMAND &
$COMMAND &
# Wait for all 3 to finish before the next round
wait
done
3x SAME TIME
#!/bin/bash
# Replace this with your actual command
COMMAND=”sleep 5″ # Example command (replace with yours)
# Run 99 loops
for i in {1..99}
do
echo “=== Round $i ===”
# Run 3 instances in the background
eval “$COMMAND” &
eval “$COMMAND” &
eval “$COMMAND” &
# Wait for all 3 to finish before looping again
wait
done