bash 脚本执行顺序 [英] bash script order of execution

查看:34
本文介绍了bash 脚本执行顺序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

bash 脚本中的行是否按顺序执行?我看不出任何原因,但我对 bash 脚本非常陌生,我有几个命令需要按顺序执行.

Do lines in a bash script execute sequentially? I can't see any reason why not, but I am really new to bash scripting and I have a couple commands that need to execute in order.

例如:

#!/bin/sh
# will this get finished before the next command starts?
./someLongCommand1 arg1
./someLongCommand2 arg1

推荐答案

是的...除非你特意在后台运行其中一个命令,否则一个命令会在下一个命令开始之前完成.

Yes... unless you go out of your way to run one of the commands in the background, one will finish before the next one starts.

这篇关于bash 脚本执行顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆