Reputation: 3971
I need to run the same Laravel command with different parameters 20 times simultaneously, how can I automate this? It is like:
php artisan do-command 1
, php artisan do-command 2
,php artisan do-command 3
, ... php artisan do-command 20
?
Also, will my laptop with i7-7500u and 8gb of ram enough to run 20-100 processes?
!!!UPDATE!!!
after the first answer i created an sh file:
#!/bin/bash
for i in {1..20}
php artisan do-command $i &
but it throws an error syntax error near unexpected token "php"
Upvotes: 1
Views: 2068
Reputation: 1794
On Linux you can add &
to end of the command for running a command on the background, for example
for i in {1..20} do
artisan do-command $i &
done
Upvotes: 1