手动输入一行字符串,并对其排序. 脚本如下: #!/bin/bash #a test about sort echo "please input a number list" read -a arrs for((i=0;i<${#arrs[@]};i++)){ for((j=0;j<${#arrs[@]}-1;j++)){ if [[ ${arrs[j]} -gt ${arrs[j+1]} ]];then tmp=${arrs[j]} arrs[j]=${arrs[j+1]…
一.基础内容 0.官方文档说明 (1)org.apache.lucene.index provides two primary classes: IndexWriter, which creates and adds documents to indices; and IndexReader, which accesses the data in the index. (2)涉及的两个主要包有: org.apache.lucene.index:Code to maintain and acces…
二进制:以0b开头,只有0和1两种数字.如0101 十进制:0~9十个数字表示.如25 十六进制:以0~9,A~F表示,以0X开头.如0X2B 十进制转换为X进制:连除倒取余 X进制转换为十进制:按权求和. 一个八进制可以由3个二进制表示 一个十六进制可以有4个二进制表示 基本数据类型:大体上分为整型和浮点型 字节:计算机中最小的储存单位 1 Byte=8 bit 整型: int 4字节 short 2字节 long 4字节或者8字节…
最近在学shell,记录一下. if语句的使用: 1.判断两个参数大小 #!/bin/sh #a test about if statement a=10 b=20 if [ $a -eq $b ];then echo "parameter a is equal to parameter b" elif [ $a -le $b ];then echo "parameter a is less than parameter b" elif [ $a -gt $b ];…