#给出一个上下限,输入一个数字,若在此区间,则该数字+3再乘2的三次方


#!/bin/bash


declare -i i

declare -i var

declare -i j

declare -i m

limit=8

limit1=16

echo "please input a number:"

read j

if [ $j -lt $limit ];then

    echo "Error,the number must bigger than $limit"

else

    i=$j

    if [ $i -lt $limit1 ];then    

        let var=i+3

        let i++

        echo $var

        m=$var

        r=$((m<<3))

#m<<2  m*2的平方,m>>3 m/2的三次方

        echo $r

    else

        echo "Error,the number must smaller than $limit1"

    fi

fi