Problem
Hi, I'm trying to make a script in bash, I need to pass two arguments to the script, in this case the path and ID of the policy, the problem occurs when I run the script with the following command line: ./allowedURLs -f ruta -i testID
the output prints the path but the ID It never catches it, I have tried to execute it with only the argument ID and it does not show it on the screen either.
Fragment of the :
#!/bin/bash
#Parsing arguments
while getopts 'if:' OPTION; do
case "${OPTION}" in
i)
echo "id"
policy_id=${OPTARG}
;;
f)
echo "file"
input_file=${OPTARG}
;;
esac
done
shift $((OPTIND-1))
echo "$# non arguments were passed"
echo "ID: $policy_id";
echo "Input file: ${input_file}";