]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
BEE Backport regress/scripts/bpipe-error-restore.sh
authorEric Bollengier <eric@baculasystems.com>
Fri, 4 Sep 2020 11:33:32 +0000 (13:33 +0200)
committerEric Bollengier <eric@baculasystems.com>
Thu, 24 Mar 2022 08:02:56 +0000 (09:02 +0100)
This commit is the result of the squash of the following main commits:

Author: Eric Bollengier <eric@baculasystems.com>
Date:   Thu Jul 12 15:48:28 2018 +0200

    regress: Add bpipe2-test to check stderr handling

regress/scripts/bpipe-error-restore.sh [new file with mode: 0755]

diff --git a/regress/scripts/bpipe-error-restore.sh b/regress/scripts/bpipe-error-restore.sh
new file mode 100755 (executable)
index 0000000..580c77f
--- /dev/null
@@ -0,0 +1,24 @@
+#/bin/sh
+
+echo "This is a message for Bacula" >&2
+
+# restore mode
+if [ $# -gt 0 ]; then
+    echo "This is an informative message"
+    read a
+    read b
+    echo "This is an error message" >&2
+    read c
+    sleep 2
+    echo $a
+    echo $b
+    echo $c
+    echo "Last line for Bacula" >&2
+    exit $1
+else
+    echo 1
+    echo 2
+    echo "An other line for Bacula" >&2
+    echo 3
+    exit 0
+fi