0
我想從配置文件中獲取時間並乘以它。 當我寫30米的時候,它需要案件m
,並使用30米。但我怎麼能用這個值進行計算。案例s
正在運行。用配置文件中的字符串值進行計算
getTimeFromConfig(){
case $timestart in
*s)
echo ${timestart::-1};;
*m)
time = ${timestart::-1}
newtime= $(($time*60));;
*h)
time = ${timestart::-1}
newtime= $(($time*3600));;
esac
}
@ 123你是什麼意思? – aha364636
你面臨的問題是什麼? –
@ l3x我不知道如何計算,如果我使用-1 – aha364636