[shell]输出月份对应的英文

#!/usr/bin/env bash

echo "please input a month(0~12):"
read month
j=0

if [ $month -gt 12 ] || [ $month -lt 0 ];
then
        echo "the month is not in 0~12!"
else
    for i in jan feb mar apr may june july aug sep oct nov dec
    do
        let j+=1;
        if [[ $month = $j ]];then
            echo "the $month month is $i! "
        else
            continue
        fi
    done
fi

版权声明:本文为qq_19659815原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。