who | while IFS= read -r line; do printf '[%s] %s\n' "$(date '+%Y-%m-%d %H:%M:%S')" "$line"; done > /path/log
who | while IFS= read -r line; do printf '[%s] %s\n' "$(date '+%Y-%m-%d %H:%M:%S')" "$line"; done > /path/log
本文标题:【问题随手记】shell 重定向增加时间戳
本文链接:https://www.haomeiwen.com/subject/wcyoqltx.html
网友评论