You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found several problems in how this is handled right now in wrapper.py. The exec_cmd function used to call the shell uses subprocess.Popen shell=True option, but this by default uses the /bin/sh shell, even ignoring the default shell of the linux distro.
The problem is that /bin/sh does not recognize the typical syntax used in BASH to redirect standart output and standard error to a file:
/bin/sh -c "echo test >& test.txt"
/bin/sh: 1: Syntax error: Bad fd number
This causes the following line to fail in ubuntu, in other linux it may work (like centos) because /bin/sh is redirected to a shell compatible with this syntax:
I found several problems in how this is handled right now in wrapper.py. The exec_cmd function used to call the shell uses subprocess.Popen shell=True option, but this by default uses the /bin/sh shell, even ignoring the default shell of the linux distro.
WRF4G/wrf4g/utils/command.py
Lines 50 to 56 in 272b1e4
The problem is that /bin/sh does not recognize the typical syntax used in BASH to redirect standart output and standard error to a file:
This causes the following line to fail in ubuntu, in other linux it may work (like centos) because /bin/sh is redirected to a shell compatible with this syntax:
WRF4G/lib/python/wrf4g/wrapper.py
Line 847 in 767a26d
The following line is also wrong because the "&>" is not redirecting the output to the log file.
WRF4G/lib/python/wrf4g/wrapper.py
Line 780 in 767a26d
We can either remove this "&" or set BASH to be the default shell to use by using the executable="/bin/bash" argument of subprocess.Popen.
The text was updated successfully, but these errors were encountered: