blob: 1b612d68a7c71a567b6dd262b7599a3a475f3c44 (
plain) (
tree)
|
|
# Record a timestamped message to a logfile, defaulting to ~/.clog
self=clog
# Ignore arguments
set --
# If we have rlwrap, quietly use it
command -v rlwrap >/dev/null 2>&1 &&
set -- rlwrap --history-filename=/dev/null -C "$self" "$@"
# Write the date, the standard input (rlwrapped if applicable), and two dashes
# to $CLOG, defaulting to ~/.clog.
{
date
"$@" cat -
printf '%s\n' --
} >>"${CLOG:-"$HOME"/.clog}"
|