• let 命令


    let命令取代并扩展了expr命令的整数算数符号。

    let除了支持5中基础的运算符。

    还支持+=,-=,*=,、-,%= 自变运算符。

    以及**幂次运算符。

    在变量计算中不需要加上$来表示变量。

    [centos@s201 ~]$ let a=1+2
    [centos@s201 ~]$ echo $a
    3
    [centos@s201 ~]$ let b=3-2
    [centos@s201 ~]$ echo $B
    
    [centos@s201 ~]$ echo $b
    1
    
    [centos@s201 ~]$ let c=8/6
    [centos@s201 ~]$ echo $c
    1
    
    [centos@s201 ~]$ let c=8%6
    [centos@s201 ~]$ echo $c
    2
    自加操作:let no++
    自减操作:let no--
    简写形式 let no+=10,let no-=20,分别等同于 let no=no+10,let no=no-20

    对空格比较严格

    [centos@s201 ~]$ let c= 8/6
    -bash: let: c=: syntax error: operand expected (error token is "=")
    [centos@s201 ~]$ let c = 8/6
    -bash: let: =: syntax error: operand expected (error token is "=")
  • 相关阅读:
    浏览器中包含什么?三个常驻线程?
    TCP粘包和拆包
    TCP有限状态机
    TCP的拥塞控制
    TCP滑动窗口实现流量控制
    http状态码及意义
    OSI七层结构
    浏览器的event loop
    history api
    表单提交的方式
  • 原文地址:https://www.cnblogs.com/wqbin/p/10885671.html
Copyright © 2020-2023  润新知