I have
A=123
B="abc${A}efg\n\
ijk"
if I echo $B it returns:
abc123efg
ijk
I want to pass B as the git commit message like this:
git commit -m $B
However, it does not create multiple lines and does not treat \n as a line break.
what should I do?
update:
this worked
git commit -m "$(echo -e "$B")"
git commit -m "$(echo -e "$B")"echo -eis buggy by nature -- see unix.stackexchange.com/questions/65803/…. Much more reliable to usegit commit -m "$(printf '%b\n' "$B")"