When redirecting the output of a python script, when echoing the output it seems to work, but when I actually use it with another object, it breaks and cuts off everything after it.
In this case, we have VERSION
set to "nice dude"
VERSION=$(python3 -c "print('nice dude')")
And printing the variable alone seems to work
$ echo $VERSION
>>> nice dude
But when I implement this value with anything else, Python for example:
$ python3 -c "print('$VERSION')"
>>> File "<string>", line 1
>>> print('nice dude
>>> ^
>>> SyntaxError: EOL while scanning string literal
Or when I print it again with some concatenation:
$ echo $VERSION hehe
>>> hehedude
I'm not sure what's happening but it seems to be some sort of carriage return when printing an output produced by python python3.9.1
.