• 打印菜单脚本


    #!/bin/bash
    #
    cat << EOF
    cpu) show cpu information;
    mem) show memory information;
    disk) show disk information;
    quit) quit
    #############################################################
    EOF
    
    read -p "Enter a option:" option
    while [ "$option" != 'cpu' -a "$option" != 'mem' -a "$option" != 'disk' -a "option" != 'quit' ];do
      read -p "Wrong option,please Enter again:" option
    done
    
    if [ "$option" == 'cpu' ];then
      lscpu
    elif [ "$option" == 'mem' ];then
      cat /proc/meminfo
    elif [ "$option" == 'disk' ];then
      fdisk -l
    else
      echo "Quit"
      exit 0
    fi
    ~      
    

      

  • 相关阅读:
    加密
    python数据类型
    json
    xml
    物理层
    计算机网络概述
    js之BOM概述
    消息队列介绍
    linux bond nmcli命令
    linux iostat
  • 原文地址:https://www.cnblogs.com/pythonal/p/7656392.html
Copyright © 2020-2023  润新知