bash getting argument using 'while getopts' and 'shift'
futhermore I need to reuse 1st optarg to every rest opt cases
In a Bash script, you can use `getopts` to parse command-line options. If you want to capture the first option argument and reuse it for the subsequent options, you can do so by storing it in a variable and then using that variable later in your script.

Here’s an example script that demonstrates this:

```bash
#!/bin/bash

# Initialize variables
first_arg=""

# Function to display usage
usage() {
    echo "Usage: $0 -f <first_arg> [-o <option>] [-p <another_option>]"
    exit 1
}

# Parse options
while getopts ":f:o:p:" opt; do
    case ${opt} in
        f)
            first_arg="$OPTARG"  # Store the first argument
            ;;
        o)
            # Use the first argument with the second option
            echo "Option -o was provided with argument: $OPTARG"
            echo "Using first_arg: $first_arg"
            ;;
        p)
            # Use the first argument with the third option
            echo "Option -p was provided with argument: $OPTARG"
            echo "Using first_arg: $first_arg"
            ;;
        \?)
            echo "Invalid option: -$OPTARG" >&2
            usage
            ;;
        :)
            echo "Option -$OPTARG requires an argument." >&2
            usage
            ;;
    esac
done
shift $((OPTIND
  Yes, you can use `getopts` and `shift` to read command-line arguments in Bash, and then reuse the first option argument for the remaining options. Here's an example of how you can do this:
```
#!/bin/bash

while getopts ":a:b:c:" opt; do
    case $opt in
        a)
            first_option_arg=$OPTARG
            ;;
        b)
            second_option_arg=$OPTARG
            ;;
        c)
            third_option_arg=$OPTARG
            ;;
        \?)
            echo "Invalid option: -$OPTARG" >&2
            exit 1
            ;;
    esac
    shift
done

# Now use the first option argument for the remaining options
echo "First option argument: $first_option_arg"
echo "Second option argument: $second_option_arg"
echo "Third option argument: $third_option_arg"
```
In this example, the `getopts` command is used to read the command-line options, and the `case` statement is used to handle each option. The `shift` command is used to remove the option from the command line after it has been handled.

The `first_option_arg` variable is set to the value of the first option