摘要: test命令用法。功能:检查文件和比较值 1)判断表达式 if test (表达式为真) if test !表达式为假 test 表达式1 –a 表达式2 两个表达式都为真 test 表达式1 –o 表达式2 两个表达式有一个为真 2)判断字符串 test –n 字符串 字符串的长度非零 test 阅读全文
posted @ 2017-09-19 20:30 蜗牛·哥 阅读(38786) 评论(0) 推荐(1) 编辑
摘要: 1.模拟linnux登录shell #/bin/bash echo -n "login:" read name echo -n "password:" read passwd if [ $name = "cht" -a $passwd = "abc" ];then echo "the host an 阅读全文
posted @ 2017-09-19 16:19 蜗牛·哥 阅读(685) 评论(2) 推荐(0) 编辑