I add this code in my shell script. But every time I add single quotation in painless( 'hello' )
It keeps giving me errors. I don't know what is wrong with my code. I hope you will be able to help with this. Thank you in advance.
cmd="curl -XPOST 'http://localhost:9200/_reindex' -H 'Content-Type: application/json'
-d '
{
"source": {
"index": "aaa"
},
"dest": {
"index": "bbb"
},
"script": {
"inline": "ctx._source.col1 = ctx._source.col2 + 'hello' ",
"lang": "painless"
}
}'
"
eval $cmd