Loading

摘要: 要求 希望通过console打印函数执行耗时 实现 通过date命令获取函数起止时间戳相减得到耗时 fcn(){ srt=$(date +%s) #do something end=$(date +%s) echo "It takes $[$end-$srt] sec." } 注意 调用$[$a - 阅读全文
posted @ 2020-07-02 11:27 azureology 阅读(766) 评论(0) 推荐(0)
摘要: 主要有两种方法: 使用if判断 read -p "Input a number(0-5): " num array=(0 1 2 3 4 5) if [[ "${array[*]}" =~ "${num}" ]]; then echo "You select $num" else echo "Inv 阅读全文
posted @ 2020-07-02 11:18 azureology 阅读(1864) 评论(0) 推荐(1)