From 37b14902028478a13dc02fe2240373cca88465f4 Mon Sep 17 00:00:00 2001 From: RealStickman Date: Sat, 25 Jun 2022 11:42:21 +0200 Subject: [PATCH] (Grav GitSync) Automatic Commit from RealStickman --- pages/04.other/14.bash/default.en.md | 37 ++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 pages/04.other/14.bash/default.en.md diff --git a/pages/04.other/14.bash/default.en.md b/pages/04.other/14.bash/default.en.md new file mode 100644 index 0000000..dd3d4ee --- /dev/null +++ b/pages/04.other/14.bash/default.en.md @@ -0,0 +1,37 @@ +--- +title: Bash +--- + +[toc] +## Returning exit status +`exit 1` + +Code | Meaning +--- | --- +0 | Success +1 | Error + +## Check for Arguments given +``` +if [ $# -eq 0 ]; then + echo "Please supply one argument" + $(exit 1); echo "$?" +elif [ $# -ge 2 ]; then + echo "Please give only one argument" + $(exit 1); echo "$?" +fi +``` +## Multiline output +``` +cat << EOF +Line 1 +Line 2 +Line 3 +EOF +``` +Will output: +``` +Line 1 +Line 2 +Line 3 +``` \ No newline at end of file