Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagebash
#!/bin/bash
 
# Copyright 20192020 ForgeRock AS. All Rights Reserved
#
# Use of this code requires a commercial software license with ForgeRock AS.
# or with one of its affiliates. All use shall be exclusively subject
# to such license between the licensee and ForgeRock AS.
#
# Comment description of what the script does here.
 
error=0
verbose=0
index=
basename=$(basename $0)

while getopts ':i:v-:' arg "$@"; do
  case $arg in
    -)  case "$OPTARG" in
           verbose)  verbose=1 ;;
           index*)   index=${OPTARG#*=} ;;
        esac ;;
    i)  index=$OPTARG ;;
    v)  verbose=1 ;;
    ?)  error=1 ;;
  esac
done

let x=OPTIND-1
shift $x

if (( error )); then
    echo "Usage: $basename [-v|--verbose] [-i index] [--index=ind] [arguments]"
    echo "-v"
    echo "--verbose    enable verbose debugging output"
    echo "-i ind"
    echo "--index=ind  use a value of \"ind\" for the index"
    echo "etc."
    echo "etc."
    exit 9
fi

...