Linux bash parallel `&` vs serial `&&` All In One
Linux bash parallel &
vs serial &&
All In One
&
并行 vs&&
串行
&
是使用并行模式
执行多个命令,同时
并行执行左右边命令;
parallel 并行
concurrent 并发
&&
是使用串行模式
执行多个命令,先
执行左边命令,后
执行右边命令 (先左后右,依次执行);
serial 串行
serially 串行
npm script
concurrently
同时/并发
https://www.npmjs.com/package/concurrently
demo
{
"scripts": {
"dev": "next dev",
"start": "next start",
"build": "next build",
"parallel": "echo 并行 & next build & next export",
"serial": "echo 串行 && next build && next export",
"export": "next export",
"lint-auto-fix": "next lint --fix",
"lint": "next lint"
},
}
# 并行 &
$ yarn parallel
## 串行 &&
$ yarn serial
Linux parallel and serial
https://saveriomiroddi.github.io/Running-shell-commands-in-parallel-via-gnu-parallel/
https://stackoverflow.com/questions/29953990/run-serial-inside-paralell-bash
refs
https://www.cnblogs.com/xgqfrms/p/16137768.html
https://github.com/xgqfrms/set-process-env/issues/5#issuecomment-1096808624
©xgqfrms 2012-2020
www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!
原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!
本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/16179772.html
未经授权禁止转载,违者必究!