Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting Environment Variable ends with "-bash: !": event not found"

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="[email protected]" 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="[email protected]" 

This does not:

firebase functions:config:set gmail.email="[email protected]" 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.

like image 508
Michael R Avatar asked Feb 28 '26 08:02

Michael R


1 Answers

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="[email protected]" \
    gmail.password='MyPassword1!'

See also this question for reference.

like image 175
norbjd Avatar answered Mar 03 '26 00:03

norbjd



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!