#!/bin/bash
# a small tool for logging sommething
#
# 1. read your input
# 2. save to logs file >> ~/logs/$(date +%F)
#
logDir='2-logs'
read -p "好记性不如烂笔头,please input info: " info
echo $info >> ~/$logDir/$(date +%F)
## if faild, output
[ $? -eq 0 ] || echo "logging failed"
标签:info,shell,logging,logs,echo,input
From: https://www.cnblogs.com/dewan/p/16872847.html