1 Star 0 Fork 0

dddachui/openeuler-init

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
read-history 392 Bytes
一键复制 编辑 原始数据 按行查看 历史
dddachui 提交于 2023-07-23 16:56 +08:00 . 读取history日志
#! /bin/bash
historyfile=$1
if [ $# != 1 ];then
echo "Usage: read-history historyfile"
exit 1
fi
while read line
do
echo $line | grep "^#[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]$" &> /dev/null
if [ "$?" = "0" ];then
historytime=`date -d "1970-01-01 UTC ${line:1} seconds" "+%F %H:%M:%S"`
echo -en "$historytime "
else
echo -e $line
fi
done < $historyfile
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Shell
1
https://gitee.com/wangdachui2019/openeuler-init.git
git@gitee.com:wangdachui2019/openeuler-init.git
wangdachui2019
openeuler-init
openeuler-init
master

搜索帮助