What is my MacBook's firmware password after using setregproptool?
Since OLDPASSWORD and CONFIRMPASSWORD are both unset, the command your script executed was:
/Volumes/OS\ X\ Base\ System/Applications/Utilities/Firmware\ Password\ Utility.app/Contents/Resources/setregproptool -m command -p -o
I don't know for certain (and I'm not about to test it), but I'd expect that this has taken "-o" as an argument to the "-p" option, and hence set the firmware password to "-o".
BTW, in addition to removing the spaces after the "=" in assignments, you should also double-quote all references to variables, like this:
/Volumes/OS\ X\ Base\ System/Applications/Utilities/Firmware\ Password\ Utility.app/Contents/Resources/setregproptool -m command -p "$CONFIRMPASSWORD" -o "$OLDPASSWORD"
This will prevent the shell from doing weird things with variables that contain spaces and/or wildcards, or are blank (like OLDPASSWORD
in your script).