首页 > 解决方案 > 如何在 bash 脚本中启动单独的 bash 脚本?

问题描述

这真的很可怕。我已经尝试了很多(如果不是全部)从 bash 脚本中启动单独的 bash 脚本的各种方法。

这实际上是我简化故障排除的方式:

#!/bin/bash

TITLE="Simple Script Function"

#This actually is the path to the script I want to start.
ROBUST="/GrEase (for Diasteirasein)"


function start_separate_script() {
source "$ROBUST" 
}

dialog --title "$TITLE" --clear \
   --yesno "You're about to start a script. \n\n          Are you ready?"      11 41

return_value=$?
if [ "$return_value" = "1" ]
then
dialog --title "$TITLE" --clear \
     --msgbox "You seem unsure of yourself." 11 41
exit
else
dialog --title "$TITLE" --clear \
     --msgbox "If you programmed your function correctly & you can incite a separate script out of this script, then your script should now start." 11 41
start_separate_script;
#Simply does not work.
# :(
exit
fi

我将非常感谢您的帮助。谢谢。:)

标签: bashdialog

解决方案


推荐阅读