sudo ./launch-missiles.sh --target=[REDACTED] --missile-count=4 --username=jbiden --password=11110000000
> during the height of the Cold War, the US military put such an emphasis on a rapid response to an attack on American soil, that to minimize any foreseeable delay in launching a nuclear missile, for nearly two decades they intentionally set the launch codes at every silo in the US to 8 zeroes
http://www.todayifoundout.com/index.php/2013/11/nearly-two-d...
...so, a quasi-implicit-and-optional parameter.
Edit: on a related note, a few years ago I was shocked to hear the story of how a simple accident while carrying out routine maintenance of liquid-fuelled nuclear missiles almost resulted in a devastating nuclear explosion in the American heartland: https://www.thisamericanlife.org/634/human-error-in-volatile...
-j 4The safe way is to either read it from stdin/fd (maybe call isatty(3) to check if someone doesn't echo password | ./foo), or open a file (check if permissions are 600). You could also have a named socket (check permissions!) talking to an authn agent, which could be doing some other fancy stuff like pinging your smartwatch to confirm, etc.
gpg -d ~/secrets/nuclear_launch_codes.gpg
source ~/secrets/nuclear_launch_codes
where the gpg key has a password and is stored on a hardware dongle that doesn't allow copying the private key off. If you really want to be fancy, there are some hardware security keys that also require a biometric to confirm.The other option is something like Hasicorp Vault, but we're way out of "one line bash" territory :p
Please nobody rely on this behavior. :O