I tried to change the bd script to use getopts. I'm new to bash scripting
my script -
while getopts ":hvis:d:" opt
do
...
done
...
echo $somedirpath
cd "$somedirpath"
this works great when executed
$ ./bd -v -i -s search
or
$ ./bd -is search -d dir
But when you run this type
$ . ./bd -s search
getoptsdoesn't read arguments at all. And all the variables set in the loop whileaccording to the arguments are not set, so the script no longer works. Please, help!
source
share