$_env is unset due to how you pass arguments to getopts.
You need to add a colon after the e to tell getopts the option takes an argument.
while getopts "p:e:" op
^
mandatory here
Check:
help getopts | less
$_env is unset due to how you pass arguments to getopts.
You need to add a colon after the e to tell getopts the option takes an argument.
while getopts "p:e:" op
^
mandatory here
Check:
help getopts | less