shell if判断总结
#!/bin/bash
#echo -n "please input your score:"
#read score
#echo "input score is $ score "
read -p "please input a score:" score
echo -e "your score [$score] is judging by sys now"
if [ "$score" -ge "" ]&&[ "$score" -lt "" ];then
echo "sorry,you are lost!"
elif [ "$score" -ge "" ]&&[ "$score" -lt "" ];then
echo "just soso!"
elif [ "$score" -le "" ]&&[ "$score" -ge "" ];then
echo "good job!"
else
echo "input score is wrong , the range is [0-100]!"
fi
shell if判断总结的更多相关文章
- 在Shell里面判断字符串是否为空
在Shell里面判断字符串是否为空 分类: Linux shell2011-12-28 23:18 15371人阅读 评论(0) 收藏 举报 shell 主要有以下几种方法: echo “$str” ...
- shell 脚本——判断条件
在之前的shell语言学习笔记中已经写过shell的几种判断语句及循环语句,也简单的介绍了shell语言判断语句和判断条件.在此再做进一步学习. test命令的测试功能 test命令用于检测系统文件及 ...
- Shell实现判断进程是否存在并重新启动脚本
Shell实现判断进程是否存在并重新启动脚本 - superbfly的专栏 - CSDN博客 https://blog.csdn.net/superbfly/article/details/52513 ...
- shell if判断中常用的a-z表达式含义
shell if判断中常用的a-z表达式含义 可通过在在linux中man test命令查看下列参数的详细用法 [ -a FILE ] 如果 FILE 存在则为真. [ -b FILE ] 如果 ...
- Makefile中怎么使用Shell if判断
/********************************************************************* * Makefile中怎么使用Shell if判断 * 说 ...
- Shell脚本 判断
#Linux系统Shell脚本判断变量文件目录:权限.是否存在.空值.相等 1.字符串判断 str1 = str2 当两个串有相同内容.长度时为真str1 != str2 当串str1和str2不等时 ...
- Linux shell脚本判断服务器网络是否可以上网
Linux shell脚本判断网络畅通 介绍 在编写shell脚本时,有的功能需要确保服务器网络是可以上网才可以往下执行,那么此时就需要有个函数来判断服务器网络状态 我们可以通过curl来访问 www ...
- [Shell]条件判断与流程控制:if, case, for, while, until
---------------------------------------------------------------------------------------------------- ...
- shell脚本判断文件类型
转自:http://www.cnblogs.com/sunyubo/archive/2011/10/17/2282047.html 1. shell判断文件,目录是否存在或者具有权限 2. #!/bi ...
- shell if判断的种类
if [ $# != 1 ] ; then echo "USAGE: $0 TABNAME" echo " e.g.: $0 CDR_CALL_20040701" ...
随机推荐
- BFS HDOJ 1242 Rescue
题目传送门 题意:从r走到a,遇到x多走一步,问最小走到a的步数 分析:因为r有多个,反过来想从a走到某个r的最小步数,简单的BFS.我对这题有特殊的感情,去年刚来集训队时肉鸽推荐了这题,当时什么都不 ...
- 137 Single Number II 数组中除了一个数外,其他的数都出现了三次,找出这个只出现一次的数
给定一个整型数组,除了一个元素只出现一次外,其余每个元素都出现了三次.求出那个只出现一次的数.注意:你的算法应该具有线性的时间复杂度.你能否不使用额外的内存来实现?详见:https://leetcod ...
- Suricata的初始化脚本
见官网 https://suricata.readthedocs.io/en/latest/initscripts.html
- pandas DataFrame 警告(SettingWithCopyWarning)
转自:https://www.cnblogs.com/pig-fly/p/7875472.html 刚接触python不久,编程也是三脚猫,所以对常用的这几个工具还没有一个好的使用习惯,毕竟程序语言是 ...
- sqlserver:查询锁住sql以及解锁
--查看被锁表:SELECT request_session_id spid, OBJECT_NAME( resource_associated_entity_id ) tableNameFROM s ...
- codevs 2761 脏话过滤
时间限制: 1 s 空间限制: 8000 KB 题目等级 : 白银 Silver 题目描述 Description 某论坛希望打造文明论坛,对于每个帖子需要将脏话换成*输出. 脏话有38,25 ...
- [Python學習筆記] 利用 Python在Excel 插入註解
用Python 來處理excel 檔 用過了 openpyxl 還有 pyexcel目前覺得除了讀寫如果還要使用另外的功能 (像是讀取格子裡的公式)可以用 xlwings 他的首頁標題 " ...
- CSS 循环动画效果。
@-moz-keyframes revolving{ 0{ -moz-transform: rotate(0deg); -webkit-transform: rotate(0deg); } 25%{ ...
- 【Hive】explain command throw ClassCastException in 2.3.4
参考:https://issues.apache.org/jira/browse/HIVE-21489 (一)问题描述: Hive-2.3.4 执行 explain select * from sr ...
- vueCode 常用代码总结 20190116
<template>props 传参<in-body :mbx="['首页','','']"> props 代码使用<BreadcrumbItem&g ...