This commit is contained in:
Olli Graf
2024-09-08 11:33:42 +02:00
parent 407d7ef5c0
commit 36837548d2
3 changed files with 24 additions and 0 deletions

10
teil14/ifexit.sh Executable file
View File

@@ -0,0 +1,10 @@
#! /usr/bin/bash
./sub.sh ${1}
if [ ${?} -eq 0 ]; then
echo "sub.sh erfolgreich"
else
echo "sub.sh fehlgeschlagen"
fi

4
teil14/simpleexit.sh Executable file
View File

@@ -0,0 +1,4 @@
# /usr/bin/bash
echo "Beispiel für exit Code"
exit 2

10
teil14/sub.sh Executable file
View File

@@ -0,0 +1,10 @@
# !/usr/bin/bash
if [ "${1}" == "fail" ]; then
echo " ${0}: failing"
exit 1
fi
exit 0