STDOUT redirect to empty filename causing issues for some users.
We have a business application, in AIX server, which is executing the below line of code successfully. Note that the original developer did a mistake and didn't define the TFILE variable anywhere in the script. Though the TFILE variable is not defined anywhere, the script is running fine. We printed the TFILE value in the log files and verified that it's blank.
OUT_VALUE="$(/dev/bin/get.sh 2> ${TFILE})"
However, when I execute the same script using my credentials, I am getting the below error
"/dev/bin/load.sh[425]: : cannot open".
'load.sh' is the script name which has the above mentioned line of code.
I can fix this error by defining the TFILE variable with some temp file name.
However, I would like to understand how the business application(it has it's own user credentials) is able to execute the same line of code without any error and why it's giving error for my user credentials.
I do not have much Linux experience and any help on this issue is highly appreciated.
|