3

I am setting up a typical email function for firebase to alert me when a new record is added. In my terminal, I am inputting the following:

firebase functions:config:set gmail.email="MyEmail@gmail.com" gmail.password="MyPassword1!"

This returns the error: -bash: !": event not found

I CAN set just the email if i want and it works fine, but setting the password gets me this issue. So, this works:

firebase functions:config:set gmail.email="MyEmail@gmail.com" 

This does not:

firebase functions:config:set gmail.email="MyEmail@gmail.com" gmail.password="MyPassword1!"

or

firebase functions:config:set gmail.password="MyPassword1!"

Thoughts??

I would expect this to work and in fact i previously had it working.

Michael R
  • 93
  • 1
  • 8
  • Does this answer your question? [echo "#!" fails -- "event not found"](https://stackoverflow.com/questions/11816122/echo-fails-event-not-found) – tripleee Jan 29 '22 at 16:31

1 Answers1

10

You got an error message because ! character in your password is expanded by bash (you are using double quotes). Try simple quotes instead :

firebase functions:config:set \
    gmail.email="MyEmail@gmail.com" \
    gmail.password='MyPassword1!'

See also this question for reference.

norbjd
  • 10,166
  • 4
  • 45
  • 80