How can I able to read the flags after the positional arguments.
echo $1
echo $2
while getopts "j:" opt; do
echo $opt $OPTIND $OPTARG
done
$ bash test.sh arg1 arg2 -f flag1
// out: arg1
arg2
Not able to get the flag. But if i place the flag argument before the positional then im able to get the flag and its arg