I am trying to append to the first line the value of a variable within a loop so, in each iteration the line growth. I am trying
sed -i '1s/.*/& $(echo "T$(echo "$j-3" | bc -l)_S$k")/' T_iSlicesExtraction_2.csv
so, I am trying to add the value of $(echo "T$(echo "$j-3" | bc -l)_S$k") to the first line. but I am having an issue "scaping" the different special characters, and I am a little bit lost with this. I tried to scape the $ with \ without luck.