The XFILEBASE64 variable has base64 encoded content, and I want to replace some string with base64 content.
Of course, base64 is packed with special characters, and I tried to use $ '\ 001' as a delimiter, still getting the error message. Any suggestions?
XFILEBASE64=`cat ./sample.xml | base64` cat ./template.xml | sed "s$'\001'<Doc>###%DOCDATA%###<\/Doc>$'\001'<Doc>${XFILEBASE64}<\/Doc>$'\001'g" > sed: -e expression
EDIT: it seems the problem has nothing to do with sed, it should be hidden in base64 operations.
sample.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <a>testsdfasdfasdfasfasdfdasfdads</a>
To reproduce the problem:
foo=`base64 ./sample.xml` echo $foo | base64 --decode <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <base64: invalid input
bash shell base64 sed
user52028778
source share