# Linux `true` `false`
Today when I was answering a
question (opens new window)
on StackOverflow about how to force Git to fail when it prompts for a password (for example, for HTTP
Authentication), I saw that git had a GITASKPASS
environment variable (opens new window). It lets you specify the program git needs to call to ask you for a password.
I suspected that there must be some built-in "blank" script in Linux that just does nothing and exists, but couldn't find one. So I suggested
creating setting GITASKPASS
to an empty script. After I posted my answer, gspr (opens new window)
suggested using either the true
or false
command.
true
does "nothing" and then returns a zero/success exit code. false
also does
nothing, but returns a non-zero/fail exit code.
true
ended up being perfect for the purposes of GITASKPASS
.
Newsletter
If you'd like to subscribe to my blog, please enter your details below. You can unsubscribe at any time.