Skip to main content
2 of 2
added 77 characters in body
ilkkachu
  • 147.9k
  • 16
  • 268
  • 441

$_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
Gilles Quénot
  • 36.7k
  • 7
  • 74
  • 97