Issue
I am trying to store my secret of type SharedAccessToken in dot env however I am getting an error. Below is my code sample
.env file
accessToken=SharedAccessToken integration&ndkngkdhkgkdfbknbkjbkfjkotnfkobfnokbn+%^&$&^%#$^&^
when I try to load the variable into the environment, it shows in bash shell something like below:
.env:5: parse error near `&'
Looks like it's unable to parse special characters like &, ^, spaces, etc.
Solution
You can put your token under double quotes (" ") and it should work, I have tested the same in my system and its working.
Rahuls-Linux ~/test $ cat .env
accessToken="SharedAccessToken integration&ndkngkdhkgkdfbknbkjbkfjkotnfkobfnokbn+%^&$&^%#$^&^"
Rahuls-Linux ~/test $ echo $accessToken
SharedAccessToken integration&ndkngkdhkgkdfbknbkjbkfjkotnfkobfnokbn+%^&$&^%#$^&^
Rahuls-Linux ~/test $
Answered By - Rahul Rupani Answer Checked By - Marie Seifert (WPSolving Admin)