When i tried to excute the following export SENTRY_SECRET_KEY="k(#!st-6eb2y74=@^6s7a67fy5a&@p3y=57#aszb@hs)n^vv0#" I get the error "bash: !st: event not found" Please give me solution..
2 Answers
Use '
instead of "
and your variable export will work.
The '!' is interpreted as a history invocation, so your command history is searched for 'st' which causes an 'event not found' message.
You can verify this with the following sequence:
ls /etc
a="k!ls"
b='k!ls'
and then:
$ echo $a
kls /etc
$ echo $b
k!ls
Please Use single quotes (') instead double quotes ("). Strings and special characters inside single quotes usage in bash variables are interpreted literally. For an example the usage of ! or $ symbols inside double quotes are interpreted as special characters. Please read more into the documentation. So your command will look like:
export SENTRY_SECRET_KEY='k(#!st-6eb2y74=@^6s7a67fy5a&@p3y=57#aszb@hs)n^vv0#'