#!/bin/bash cat <<EOF cpu)display cpu information mem)display mem information disk)display disk information quit)display quit information EOF while read -p "please input :" value do while [ $value != "cpu" -a $value != "mem" -a $value != "disk" -a $value != "quit" ] do read -p "please input 'cpu|mem|disk|quit' :" value done if [ "$value" == "cpu" ] then lscpu elif [ "$value" == "mem" ] then free -m elif [ "$value" == "disk" ] then fdisk -l /dev/[hs]d[a-z] elif [ "$value" == "quit" ] then exit 0 fi done
shell-menu
原创
©著作权归作者所有:来自51CTO博客作者黑夜给了的原创作品,请联系作者获取转载授权,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章