如果你想通过shell来比较两个版本号字符串,比如两个版本号1.1.2和1.2.1这两个版本谁是比较新的。

最简单的就是使用sort命令。加上参数"-V"后sort命令就可以把文本中的版本号给排序出来(默认是递增的排序),然后你想倒序排序的话那就使用参数"-rV"即可。

参考链接:http://www.linuxdown.net/install/faq/20160319_how_linux_5069.html

如何使用Shell判断版本号的大小的更多相关文章

  1. C#自带的Version判断版本号的大小

    Version version1 = new Version("1.0.0.25"); Version version2 = new Version("1.0.0.24& ...

  2. shell判断文件是否存在

    转自:http://www.cnblogs.com/sunyubo/archive/2011/10/17/2282047.html 1. shell判断文件,目录是否存在或者具有权限 2. #!/bi ...

  3. Linux shell判断文件和文件夹是否存在

    shell判断文件,目录是否存在或者具有权限 #!/bin/sh myPath="/var/log/httpd/" myFile="/var /log/httpd/acc ...

  4. shell 判断字符串是否为数字

    本篇文章主要介绍了"shell 判断字符串是否为数字",主要涉及到shell 判断字符串是否为数字方面的内容,对于shell 判断字符串是否为数字感兴趣的同学可以参考一下. #!/ ...

  5. shell判断条件是否存在

    1. shell判断文件,目录是否存在或者具有权限 2. #!/bin/sh 3. 4. myPath="/var/log/httpd/" 5. myFile="/var ...

  6. shell 判断文件、目录是否存在

    shell判断文件是否存在   1. shell判断文件,目录是否存在或者具有权限 2. #!/bin/sh 3. 4. myPath="/var/log/httpd/" 5. m ...

  7. Shell 判断文件或文件夹是否存在

    #shell判断文件夹是否存在 #如果文件夹不存在,创建文件夹 if [ ! -d "/myfolder" ]; then mkdir /myfolder fi #shell判断文 ...

  8. input type='file' 上传文件 判断图片的大小是否合格与witdh 和 height 是否合格

    function CheckFiles(obj) { var array = new Array('gif', 'jpeg', 'png', 'jpg'); //可以上传的文件类型 if (obj.v ...

  9. [转] Linux shell判断文件和文件夹是否存在

    shell判断文件,目录是否存在或者具有权限 #!/bin/sh myPath="/var/log/httpd/" myFile="/var /log/httpd/acc ...

随机推荐

  1. Tomcat线程数与处理速度的关系

    问题:Tomcat线程数是不是越大越好呢? 答案肯定是否定的. Tomcat的处理速度跟线程数不是完全成正比的,设置不恰当会出现相反的效果.服务的负载计算包括了CPU的使用率和资源等待. 第一种情况, ...

  2. PHPStorm + Homestead + Xdebug + Chrome Xdebug Helper 调试配置

    话说 PHPStorm 写起代码来非常带感,各种提示补全和纠错,以及在 L5 中的命名空间功能更是强大到感动(新建类自动添加命名空间,自动引入命名空间,返回参数命名空间纠正等等).当然它的调试功能更是 ...

  3. .NET HttpPost 上传文件图片到服务器

    public class ImageData { public string imageFilePath { get; set; } public string tempFilePath { get; ...

  4. virtualbox安装android6.0并设置分辨率为1920x1080x32

    下载安装:https://www.cnblogs.com/wynn0123/p/6288344.html 这里我做的是下载android6.0-64bit,然后文件系统只支持ext4 安装完成之后我的 ...

  5. windows下JDK环境配置与Android SDK环境配置

    一.JDK环境配置1.配置变量名:JAVA_HOME变量值:jdk安装的绝对路径. 变量名:Path(在系统变量中找到并选中Path点击下面的编辑按钮,不要删除原本变量值中的任何一个字母,在这个变量值 ...

  6. SetProcessWorkingSetSize减少内存占用

    [DllImport("kernel32.dll", EntryPoint = "SetProcessWorkingSetSize")] public stat ...

  7. hdoj:2050

    #include <iostream> using namespace std; int main() { int T; while (cin >> T) { ; i < ...

  8. Maven项目:Malformed POM expected START_TAG or END_TAG ........

    今天在执行maven命令 mvn assembly:assembly -Dmaven.test.skip=true的时候报了个错,大概是Malformed POM expected START_TAG ...

  9. C# 移除Response Header,403调整返回为404Make IIS return a 404 status code instead of 403

    Server Information Revealed For the benefit of those who land here through a google/bing search:: He ...

  10. Adding ASP.NET MVC5 Identity Authentication to an existing project

    Configuring Identity to your existing project is not hard thing. You must install some NuGet package ...