`
zhengdl126
  • 浏览: 2531032 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类

read case

 
阅读更多
read -p "请输入安装程序编号:" n
case $n in
  1)
    read -p "确定要安装程序吗?[Y/y]" s
    if [ $s == "Y" -o $s == "y" ];then
            nginx_install
    else
            printf "没有选择[Y/y]安装程序,程序退出!\n"
            echo -e "\033[40;37m"
            exit 1
    fi
  *)
  echo "没有选择安装程序编号,程序退出!"
        echo -e "\033[40;37m"
        exit 1
esac

 
分享到:
评论

相关推荐

    052903shell循环 read case1

    综上所述,通过`for`、`while`循环以及`case`语句,我们可以编写出交互式的Linux脚本来处理各种任务,如用户管理、系统信息查询和网络监控等。同时,结合`read`命令获取用户输入,使得脚本更加灵活和用户友好。

    稀疏线性代数方程组求解_LDU分解_线性方程组求解_稀疏技术_

    - `readcase.m`:此文件可能用于读取测试案例的数据,如矩阵A和向量b。 在实际应用中,稀疏线性方程组求解广泛应用于各种科学计算和工程问题,如结构力学、流体力学、电路分析等。掌握LDU分解及其相关算法对于理解...

    Fluent Overview 软件综述,很全面

    2. **读取案例和数据**: 使用“File”菜单中的“Read Case/Data”选项读取预先准备的案例文件(如elbow.cas)和数据文件(如elbow.dat)。Fluent允许用户一次指定案例名称,自动读取关联的数据文件。 3. **探索菜单...

    多机系统短路故障后时域仿真_暂态稳定_多机系统_电力系统故障_时域仿真_

    5. `readcase.m`:读取案例数据的函数,可能用于加载系统配置或故障设定等信息。 通过这些脚本的执行,我们可以得到电力系统在短路故障后的动态响应,包括发电机转速、电压、电流等关键量的时间序列,进而分析系统...

    shell脚本和case 使用相关的例子

    read -p "请输入一个数字(1, 2, 3):" num case $num in 1) echo "你选择了1" ;; 2) echo "你选择了2" ;; 3) echo "你选择了3" ;; *) echo "无效的输入" ;; esac ``` 这个脚本会提示用户输入一个...

    concussion:读取和写入HTTP标头对象

    // use read function to read case-insensitive header nameassert ( concussion . read ( headers , "x-foo" ) === 42 ) ;// use write function to write case-insensitive header nameconcussion . write ( ...

    linux使用case 完成简单的计算器编制

    在本例中,我们将探讨如何使用`case`语句编写一个简单的计算器脚本,实现用户输入两个数字和运算符后进行计算的功能。 首先,让我们了解`case`语句的基本结构。在bash shell中,`case`语句用于根据不同的条件执行...

    Python Machine Learning Case Studies 2017

    You will read about machine learning techniques that can provide support to your products and services. The book also highlights the pros and cons of each of these machine learning concepts to help ...

    Python for Programmers: with Big Data and Artificial Intelligence Case Studies

    Please read the Table of Contents diagram inside the front cover and the Preface for more details. In the context of 500+, real-world examples ranging from individual snippets to 40 large scripts ...

    matlab开发-工程动态case3

    9. **文件I/O**:读取实验数据或保存仿真结果,通常会用到MATLAB的文件输入输出函数,如`readmatrix`、`save`等。 在学习和应用这个案例时,用户不仅可以深化对动力学理论的理解,还能掌握MATLAB在解决实际工程问题...

    我想用switch…case语句实现输入几个数字显示每个相应的颜色的程序.txt

    根据您提供的信息以及需求,我们将探讨如何使用 `switch...case` 语句来实现一个程序,该程序能够根据用户输入的数字显示相应的颜色。我们首先理解原始代码的功能,然后逐步过渡到使用 `switch...case` 实现同样的...

    词法分析,初学者用来分析词法

    case '-':printf("$minus");read();break; case '=':printf("$equal");read();break; case '(':printf("$LParen ");read();break; case ')':printf("$RParen ");read();break; case '+':printf("$plus ");...

    spark-db-case-class:将Spark DB名称映射到case类中的字段

    这里,`SparkSession.read.dbCaseClass`方法接受数据库名和表名,返回的DataFrame已经映射到`User` case类。`as[User]`操作将DataFrame转换为`User`类型,`collect()`则将数据收集到本地的Scala集合中。 此外,`...

    ATM机取款USE CASE的详细规格说明(英文)

    2. **读取卡片(Read Card)** - 系统从卡片上读取银行客户的信息。 3. **验证客户(Authenticate Customer)** - 包含“验证客户”USE CASE,用以确认使用该银行卡的个体身份。 4. **选择取款(Select Withdrawal)** ...

    shell中case的用法学习笔记

    shell中的case语句:可以把变量的内容与多个模板进行匹配,再根据成功匹配的模板去决定应该执行哪部分代码。 使用格式:case 匹配母板 in模板1 [ | .../bin/shecho “Please input \”yes\” or \”no\””read varcase

    shell read指令

    case $answer in Y|y) echo "Fine, continue";; N|n) echo "Ok, goodbye";; *) echo "Error choice";; esac ``` #### 输入不显示 在处理敏感信息如密码时,我们通常不希望用户输入的信息显示在屏幕上。`-s`...

    Shell脚本case语句简明教程

    read aNum # 使用case语句根据用户输入的数字显示不同的信息 case $aNum in 1) echo 'You select 1' ;; 2) echo 'You select 2' ;; 3) echo 'You select 3' ;; 4) echo 'You select 4' ;; *) echo '...

    详解shell脚本中的case条件语句介绍和使用案例

    在Shell脚本编程中,`case`条件语句是一种强大的多分支控制结构,它允许我们根据变量的值来执行不同的代码块。在本文中,我们将深入理解`case`语句的用法,并通过实例来演示如何在实际场景中应用。 ### 1. `case`...

Global site tag (gtag.js) - Google Analytics