From 755177bbfcf4c46ad1ac31ad9501a6c8725b1a68 Mon Sep 17 00:00:00 2001 From: Kerin Millar Date: Sun, 2 Jun 2024 04:36:27 +0100 Subject: Add the warn() function This will be used internally by a forthcoming commit. Signed-off-by: Kerin Millar --- functions.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/functions.sh b/functions.sh index 9736747..a97dde7 100644 --- a/functions.sh +++ b/functions.sh @@ -473,6 +473,14 @@ vewend() fi } +# +# Prints a diagnostic message prefixed with the basename of the running script. +# +warn() +{ + printf '%s: %s\n' "${0##*/}" "$*" >&2 +} + # # Determines whether the first parameter is truthy. The values taken to be true # are "yes", "true", "on" and "1", whereas their opposites are taken to be -- cgit v1.2.3-65-gdbad