【发布时间】:2015-05-12 23:06:55
【问题描述】:
我想询问用户的输入,例如:
Echo "Please enter name: "
read name
read -r -p "Is this a costumer? (Y/N)" response;
if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]
then
echo "Please enter name: "
read name
AreYouDone
else
"Please enter name "
read name2
AreYouDone
fi
echo $name is a costumer
echo $name2 is an employer
我们的想法是不断询问 name 和 name2 并根据 Y/N 答案在最后打印它们。
但是如何将它们存储到不同的变量中呢?**
可能有 20 个名字,有些是客户,有些是雇主。
附注:
为了消除任何混淆,如果有的话,AreYouDone 只是一个函数,当客户完成并已经实现时,它会退出程序。
谢谢。
【问题讨论】:
-
您是在与制作或供应服装的人(又名客户)打交道,还是与购买东西的人(又名顾客)打交道?