From ee1909f047200d3e22d8c3e054a06b732d4a9a3b Mon Sep 17 00:00:00 2001 From: Patrick Kerwood Date: Sun, 16 Jun 2024 17:52:09 +0200 Subject: [PATCH] updated bash script commandline args post --- src/posts/creating-bash-script-with-arguments/README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/posts/creating-bash-script-with-arguments/README.md b/src/posts/creating-bash-script-with-arguments/README.md index b6f8e24..d5665b3 100644 --- a/src/posts/creating-bash-script-with-arguments/README.md +++ b/src/posts/creating-bash-script-with-arguments/README.md @@ -6,8 +6,8 @@ excerpt: When creating a good bash script for others to use, it's important to c blog: true tags: [bash] meta: -- name: description - content: How to create a bash script with commandline arguments. + - name: description + content: How to create a bash script with commandline arguments. --- {{ $frontmatter.excerpt }} @@ -35,6 +35,7 @@ usage() { SLEEP=60 while [ $# -gt 0 ] ; do + # If you an argument without a value, like a boolean, do "shift 1" instead. case $1 in -s | --sleep-seconds) SLEEP="$2"; shift 2 ;; -e | --exit-code) EXIT="$2"; shift 2 ;;