我对在 Ubuntu 上编程很陌生。我正在尝试做一个简单的 bash 脚本。
我有一个选择菜单工作,但我希望在其中做出的选择进入许多 if 语句,对应于所做的选择。
例如,这是伪代码:
Choose from the following
a)
b)
c)
a selected
if a is selected
then
run this script
fi
if b selected
then
run this script
fi
if c selected
then
run this script
Run Code Online (Sandbox Code Playgroud)
我如何将选择传递到相关的 if 语句中?
所有这些都必须从一个脚本运行。这可能很简单,但我对此很陌生,并且正在努力解决它。