如何从Linux中的bash脚本运行的exec bash命令(Ubuntu的)? [英] How to run exec bash command from the bash script in Linux (ubuntu)?
问题描述
我有一个bash脚本,我想这样的运行命令。
I have a bash script and I want to run commands like these.
First-Command \
&& exec bash \
&& Last-Command
使用exec bash将在上述方式抛出一个错误。 ^^
The exec bash will throw a error in the above way. ^^
如果我写的是这样的:
First-Command;
exec bash;
Last-Command
因为我想先运行命令完成后才能EXEC的bash这种方式不适合我。
This way is not suitable for me because I want to run exec bash only after First-Command has completed.
有没有一种解决这种情况呢?
Is there a work around of this scenario?
我们能否一些编辑器应用程序连接到一个终端,并通过编辑器应用程序提交的命令向终端
Can we connect some editor application to a terminal and submit commands to the terminal through that editor application.
感谢您。
问候,
优素福
Thank You. Regards, Yusuf
推荐答案
EXEC
替换运行庆典
通过命令(在这种情况下,新的庆典
)。它永远不会回来,所以把&放大器;&安培;
之后,这是荒谬的。你可以通过删除修复 EXEC
。
exec
replaces the running bash
with the command (in this case, a new bash
). It will never return, therefore putting &&
after it is nonsensical. You could fix it by removing exec
.
这篇关于如何从Linux中的bash脚本运行的exec bash命令(Ubuntu的)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!