I am trying to redirect the output of a python script as an input into an interactive shell script.
test.py
print('Hello')
print('world')
Say test.py is as above prints "Hello world" which is feed to two variables using Here string redirection as below
Interactive script : read a b <<< `python3 test.py`
This is not working as expected in Rhel 8 server while it works fine in Rhel 7
Rhel 8:
tmp> read a b <<< `python3 test.py`
tmp> echo $a $b
Hello
tmp> cat /etc/redhat-release
Red Hat Enterprise Linux release 8.3 (Ootpa)
variable b is empty in rhel 8
Rhel 7:
tmp> read a b <<< `python3 test.py`
tmp> echo $a $b
Hello world
tmp> cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.8 (Maipo)
while the read & Here string works fine in both cases as below
tmp> read a b <<< Hello world"
tmp> echo $a $b
Hello world