I have the following script (bash under linux):
R=""
V=""
P=""
while getopts r:v:p: flag
do
case "${flag}" in
r) R=${OPTARG};;
v) V=${OPTARG};;
p) P=${OPTARG};;
esac
done
But when i call it for example like this
script.sh -r "some sring with spaces"
I get only "some" in the variable R.
Does someone see what i'm doing wrong here?
Tried different variants of quotation around nearly everything.
I want to give a para,meter -r with a path in it that may contain spaces.