1

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"

2
  • Maybe you could use a bash script? Commented May 15, 2018 at 6:17
  • @Sergio what would be the correct bash with the same command with arguments ranging 1-20? Commented May 15, 2018 at 6:27

1 Answer 1

1

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
Sign up to request clarification or add additional context in comments.

1 Comment

it says syntax error near unexpected token php'` in the line php artisan do-command

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.