以下语句,按照我的想法,输入1-5的数字应该输出 list,可执行后发现无论我输入什么,都输出 *,还望高手指教。 list="1|2|3|4|5" echo "choice 1 2 3 4 5" read choice case '$choice' in $list ) echo 'list';; * ) echo '*' esac
高手帮帮忙,我写了个简单的getops以便学习,可是系统当我输入./getopts.sh -x -y YANG -z GE *的时候,只有for里的echo显示出数据了,为什么没有打印出xopt,yopt,zopt的值啊,请问该如何做才能解决这个问题啊,下面是程序getopts.sh(我用的是redhat9.0) while getopts ":xy:z:" opt; do case $opt in X ) xopt='-x set';; Y ) yopt="-y set and called with $OPTARG";; Z ) zopt="-z set and called w...
谁有什么好办法? 突然发现, switch case 的变量都是字符型的 如果想弄一个字符串,能不能用 switch 谁用过? 给一个方法!!!
今天去帮客户解决问题 1、安装错误,他先安装BE,scsi卡和tape 驱动都没正确安装。导致磁带识别错误。正确顺序是 先 SCSI卡驱动,然后BE,安装BE选择symantec的drivers,就可以识别tape 2、无法读取linux客户端, 排错,看agent是否正确启动。ps -ef |grep beremote 如果没有启动需手动开启、/etc/init.d/VRTraulst start 如果无法连接,请确认版本号是否一直,iptables要停用。 3、无法正常定制策略,时间策略问题! 本文来自C...
现在有一个语句 select…… (case when co.status &128 = 128 then 'Act/Del' when co.status &64 = 64 then 'Pend/Act' when co.status &32 = 32 then 'active' end) from…… 想问一下如果不用case……when……,还有办法实现这个功能吗?
for num in `cat /root/test/2` do case $num in [0-100]) ((n100++));; [101-500]) ((n500++));; [501-1000]) ((n1000++));; [1001-2000]) ((n2000++));; [2001-3000]) ((3000++));; [3001-5000]) ((n5000++));; [5001-10000]) ((n10000++));; *) ((nn++));; esac done echo $n100 这样子无结果输出,请问是哪里错了? /root/test/2的内容只有...