简体   繁体   中英

Executing multiple commands lines at once

I have a set of commands

php /home/forge/mysite.com/artisan products:exportdiff --interval="daily"
php /home/forge/mysite.com/artisan products:exportdiff --interval="daily active"
php /home/forge/mysite.com/artisan images:exportdiff --interval="daily"
php /home/forge/mysite.com/artisan publications:exportdiff  --interval="daily"

When I paste them into my Terminal, all of them excecuted one-by-one except the last one. I even tried adding ; at the end, but it behave the same.

php /home/forge/mysite.com/artisan products:exportdiff --interval="daily";
php /home/forge/mysite.com/artisan products:exportdiff --interval="daily active";
php /home/forge/mysite.com/artisan images:exportdiff --interval="daily";
php /home/forge/mysite.com/artisan publications:exportdiff  --interval="daily";

I also tried

php /home/forge/mysite.com/artisan products:exportdiff --interval="daily" &&
php /home/forge/mysite.com/artisan products:exportdiff --interval="daily active" &&
php /home/forge/mysite.com/artisan images:exportdiff --interval="daily" &&
php /home/forge/mysite.com/artisan publications:exportdiff  --interval="daily"

I got

php /home/forge/mysite.com/artisan products:exportdiff --interval="daily" &&
> php /home/forge/mysite.com/artisan products:exportdiff --interval="daily active" &&
> php /home/forge/mysite.com/artisan images:exportdiff --interval="daily" &&
> php /home/forge/mysite.com/artisan publications:exportdiff  --interval="daily"    

Can someone please teach me how to prevent my last line from not executing ?

I am going to go out on a limb here and suggest you to check if your code has some invisible "funny" characters on it. You can check that with vi or vim , by using :set list .

Alternatively, delete all visible spaces (and also end of the lines), and add them again on a "nix" environment, or even better, retype all the commands in a "nix" environment and see if that works.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM