自定义日志函数 # log function pid=$$ log(){ local msg="$1" echo -e "`date "+%F %T"` [$pid] $msg" } log "are you ok"