From d64ba40b63ec2083e9a23bcaab42b0a2eb1375c7 Mon Sep 17 00:00:00 2001 From: dcoomber <47242934+dcoomber@users.noreply.github.com> Date: Sun, 27 Sep 2020 20:11:28 +0200 Subject: [PATCH] Added shellcheck source for background script examples --- examples/background-scripts/run_diskusage.sh | 1 + examples/background-scripts/run_filecontent.sh | 3 ++- examples/background-scripts/run_filename.sh | 4 +++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/background-scripts/run_diskusage.sh b/examples/background-scripts/run_diskusage.sh index d9e9ff5..9fc6ce8 100755 --- a/examples/background-scripts/run_diskusage.sh +++ b/examples/background-scripts/run_diskusage.sh @@ -24,6 +24,7 @@ unset IFS # discard STDIN for background jobs! cat >/dev/null & +# shellcheck source=examples/background-scripts/mycommands.sh source "./mycommands.sh" # check if $1 is a number diff --git a/examples/background-scripts/run_filecontent.sh b/examples/background-scripts/run_filecontent.sh index e27fc7f..9142d0d 100755 --- a/examples/background-scripts/run_filecontent.sh +++ b/examples/background-scripts/run_filecontent.sh @@ -24,6 +24,8 @@ cat >/dev/null & # watch for new files created by a trusted program WATCHDIR="/my_trusted/dir_to_watch" + +# shellcheck source=examples/background-scripts/mycommands.sh source "./mycommands.sh" # test your script and the remove ... @@ -39,4 +41,3 @@ loop_callback() { } watch_dir_loop "$WATCHDIR" - diff --git a/examples/background-scripts/run_filename.sh b/examples/background-scripts/run_filename.sh index 0c9e0fe..b89cfe2 100755 --- a/examples/background-scripts/run_filename.sh +++ b/examples/background-scripts/run_filename.sh @@ -19,11 +19,13 @@ export 'LANGUAGE=C.UTF-8' unset IFS # set -f # if you are paranoid use set -f to disable globbing -# discard STDIN for background jobs! +# shellcheck source=examples/background-scripts/mycommands.sh cat >/dev/null & # watch for new logfiles WATCHDIR="/var/log" + +# shellcheck disable=SC1091 source "./mycommands.sh" # test your script and the remove ...