Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • Does this work on centos? Commented Mar 25, 2020 at 9:43
  • @saint1729 Sure, it works on any operating system (even on Windows) that you have with bash installed, you just need to execute it. Commented Mar 26, 2020 at 15:22
  • 14
    Cool. It worked for me. But, the key needs to be only one character. I wasted almost an hour figuring this out. Commented Mar 26, 2020 at 15:40
  • Great example, wasn't clear to me what the single characters referred to at first. Another example for those stuck: while getopts "f:b:k:a:s:" opt do case "$opt" in f ) parameterFilepath="$OPTARG" ;; b ) parameterBucket="$OPTARG" ;; k ) parameterKey="$OPTARG" ;; a ) parameterAccessKey="$OPTARG" ;; s ) parameterSecretKey="$OPTARG" ;; ? ) helpFunction ;; # Print helpFunction in case parameter is non-existent esac done Commented Jun 10, 2021 at 10:00