安装向导重启

Install Wizard restart

所以,我正在尝试为我的程序制作一个安装向导。 但是,如果您输入 "n",它会询问您是否确定要取消,但是当您按 "n" 我希望它回到顶部。这可能吗?

echo "Would you like to start the NJDTL Install Wizard? [y/n]"
read startYN
if [ $startYN == y ]
  then
      echo "Starting Install Wizard. . ."
      mkdir ~/.NJDTL
    fi
    if [ $startYN == n ]
      then
          echo "Are you sure you want to cancel the Install Wizard? [y/n]"
          read CancelConfirm
          if [ $CancelConfirm = y ]
            then
                echo "Cancelling Install. . ."
                exit
              fi
          if [ $CancelConfirm = n ]
            then
                echo "Chose "n". Continuing Installation. . ."
        fi

要重新启动脚本:

exec [=10=]

更新 - 要保留您可以使用的命令行:

exec [=11=] "$@"