#!/bin/sh # # j - journal with single-line entries with timestamps # # SPDX-FileCopyrightText: 2023 Daniel Kalak # SPDX-License-Identifier: GPL-3.0-or-later # # This program is inspired by the article "Simple Tools" by James Card, # available at (among others). See # for more inforamtion. journal="${JOURNAL:?}" [ "${line:="$*"}" ] || IFS= read -r line [ "$line" ] && printf '%s %s\n' "$(date -Iseconds)" "$line" >> "$journal" tail -n5 "$journal"