I tried to set an environment variable and made an error in the input due to a new keyboard I'm not used to.

In the input (and output) below, did I accidentally start a job of some kind?

I'm mystified by what happened.

This is bash on latest OS X.

mbp:e4 m$ DATABASE_URI=jdbc:postgresql://localhost:5432/e4-data?user=m&password=?"
> "
[1] 59932
[1]+  Done                    DATABASE_URI=jdbc:postgresql://localhost:5432/e4-data?user=m

The unquoted & started a background process which set an shell variable just for that background process. Having set the variable the shell exited. You then went on to set a second variable called password with the value of question-mark newline.

| improve this answer | |

You have & in the URL and this sign mean put this command in background. You should set variable on this way (with single quotation marks):

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.