关于我们

质量为本、客户为根、勇于拼搏、务实创新

< 返回新闻公共列表

shell之case范例1

发布时间:2023-06-30 17:00:38

!/bin/bash

-- - - - - - -Script comment information - - - - - - - - - -

Author: 拉基

Email: helpdesk81@outlook.com

Creation time: 2021-01-07

FileName: yesorno.sh

Blog address: https://www.cnblogs.com/98record/

Copyright (C) 2021All rights reserved

- - - - - - - - - - - - - end - - - - - - - - - - - - - - - - - -

提示用户输入yes或no,并判断用户输入的是yes还是no,或是其它信息

read -p "请输入yes或者no:" YORN

case $YORN in
yes)
echo "你输入的是$YORN"
;;
no)
echo "你输入的是$YORN"
;;
*)
echo "你输入的是$YORN"
esac


/template/Home/leiyu/PC/Static