From 2cc10d34ae5d49db10b2ab5ad27337e2f77ec1af Mon Sep 17 00:00:00 2001 From: dtb Date: Fri, 9 Sep 2022 22:14:20 -0400 Subject: [PATCH] print debug data to stderr --- xdg-sanity.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/xdg-sanity.sh b/xdg-sanity.sh index f5febec..56ced9e 100755 --- a/xdg-sanity.sh +++ b/xdg-sanity.sh @@ -13,13 +13,13 @@ stream_config(){ # check if usage is valid if ! test -n "$1"; then - printf "Usage: %s [resource...]\n" "$argv0" + printf "Usage: %s [resource...]\n" "$argv0" 1>&2 exit 64 # sysexits(3) EX_USAGE fi # check if we have curl(1) if ! command -v curl >/dev/null 2>&1; then - printf "%s: Missing dependency: curl(1)\n" "$argv0" + printf "%s: Missing dependency: curl(1)\n" "$argv0" 1>&2 exit 71 # sysexits(3) EX_OSERR fi @@ -36,7 +36,7 @@ if ! test -n "$BROWSER"; then %s: \$BROWSER not filled. Please place the path to your default browser's executable in /etc/xdg-sanity/xdg-sanity.conf -" "$argv0" +" "$argv0" 1>&2 exit 71 # sysexits(3) EX_OSERR fi @@ -67,10 +67,10 @@ while test -n "$1"; do if [ "$MIME" = "text/html" ]; then "$BROWSER" "$argv1" elif ! handlr launch "$MIME" -- "$argv1"; then - printf "%s: %s: handlr(1) failed: " "$argv0" "$argv1" + printf "%s: %s: handlr(1) failed: " "$argv0" "$argv1" 1>&2 [ "$(command -v handlr)" = "false" ] \ - && printf "'handlr' program not found\n" \ - || printf "non-zero exit status\n" + && printf "'handlr' program not found\n" 1>&2 \ + || printf "non-zero exit status\n" 1>&2 fi shift