Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: sed: -e expression #1, char 91: unterminated `s' command #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

raihanhbh
Copy link

Problem:
I was trying to execute the following command:

sh ses_emailer.sh --subject "This is a sample email from pigeon server" --from "[email protected]" --receiver "[email protected]" --body "ses says hi" --attachment /var/www/sites/error_20200302.txt

Hence receiving the error sed: -e expression #1, char 91: unterminated s' commandonce I am adding--attachment /var/www/sites/error_20200302.txt`

Solution:
Added base64 -w 0

Wrap encoded lines after COLS character (default 76). Use 0 to disable line wrapping.

ATTACHMENT=base64 -i -w 0 $ATTACHMENT``

@rschwartz-tpn
Copy link

rschwartz-tpn commented Mar 26, 2020

This doesn't solve all problems however. If your base64 output contains a '/' (which is a valid base64 char) you want to replace all the '/' with '#' on line 65:
sed -i -e "s#{ATTACHMENT}#$ATTACHMENT#g" $TMPFILE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants