I am trying to write a script to insert the API credentials in the awscreds.template. However, the Secret contains special characters. As an example:
AWSAccessKeyId=AKIAJ5YhzvVUZnPTBVRA
AWSSecretKey=fRUZnUVUZnUvYhzvJVpwyn/xN3Oo0l3icqRy0//+
My script requests:
echo "Entre the Access Key, followed by an ENTER:"
read access
echo "Entre the Secret Key, followed by an ENTER:"
read secret
And then inserts it into the file:
sed -i '/AWSAccessKeyId=/s/$/'$access'/' awscreds.template
sed -i '/AWSSecretKey=/s/$/'$secret'/' awscreds.template
However, when I run the script I get the following:
sed: -e expression #1, char 44: unknown option to `s'
After doing a bit of research, I made sure to use the ' ' to restrict the input, but I still get the same alarm. But why am I still getting this error?