sedsed keeps giving invalid arithmetic operator error. I am trying to assign the output of sed to a variable.
This one works, var=$(sed -e 's/"currentGeneration":5010/"currentGeneration":5011/' <<< $content )
var=$(sed -e 's/"currentGeneration":5010/"currentGeneration":5011/' <<< $content ) but when iI try to do the same with variable instead of 5010 and 5011, it fails with invalid arithmetic operator var=$((sed -e 's/"currentGeneration":$currg/"currentGeneration":$nextg/' <<< $content ))
var=$((sed -e 's/"currentGeneration":$currg/"currentGeneration":$nextg/' <<< $content )) I tried below also but it won't substitute anything. var=$(sed -e 's/"currentGeneration":$currg/"currentGeneration":$nextg/' <<< $content )
var=$(sed -e 's/"currentGeneration":$currg/"currentGeneration":$nextg/' <<< $content ) I am pretty sure I am missing something basic. Learning shell scripting on the job :(