linux - 一次执行多个命令行

标签 linux ubuntu centos

我有一组命令

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"

当我将它们粘贴到我的终端时,除最后一个外,所有的都一个接一个地执行。 我什至尝试在末尾添加 ; ,但它的行为是一样的。

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";

我也试过

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"

我得到了

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"    

有人可以教我如何防止我的最后一行不执行吗?

最佳答案

我要在这里冒险并建议您检查您的代码是否有一些看不见的“有趣”字符。您可以使用 :set list 使用 vivim 检查。

或者,删除所有可见的空格(以及行尾),然后在“nix”环境中再次添加它们,或者更好的是,在“nix”环境中重新键入所有命令,看看是否可行。

关于linux - 一次执行多个命令行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41192591/

相关文章:

php - 已安装 intl 扩展,但在 phpinfo() 中看不到

c++ - 配置 : error: no boost. 找到文件系统库

linux - 为什么umask 001没有设置执行权限?

python - 在 python 中将 SIGINT 发送到 os.system

linux - 删除所有不在给定文件列表中的文件

ubuntu - cmake & Qt5 : qmake reported QT_INSTALL_LIBS as XXX but QtCore could not be found there

ubuntu - 禁用 SSH 的密码验证

java - 在 CentOS 上执行 java 时出现问题

linux - Hadoop:每个namenode和datanode只存在一瞬间

Python 将 txt 转换为 CSV