1
I have simple alias for writing to log files (this is what I have in my .profile file):
logtee() {
${TEST_LOG_FOLDER:?"empty_log_folder"}
tee -a $TEST_LOG_FOLDER/$1
}
I'm reading the folder from environment variable (so this variable holds value similar to 'd/my/logs'). However, when I try using this alias by executing echo 'this is reading path from env.variable!' | logtee whatever.log
it works, but the output is: sh.exe": /d/my/log/path: is a directory
.
Did I do something wrong? Why does reading environment variable evaluate it? I suspect it have something to do with a fact that it's an alias, because in usual .sh script similar code works without any issues
P.S. I'm using msysgit on Windows 7, may be that's the problem?
What do you mean "it's an alias"? I don't see any aliasing here (have you exported the function inside one of your scripts; e.g. ".profile" or ".bashrc", etc.). Also, why do you have "sh.exe" in the output? Are you running on Windows or Linux? And, finally, what is the output of
echo $TEST_LOG_FOLDER
. – jehad – 2016-08-02T12:17:55.537@jehad I'm sorry I wasn't clear - updated the question – chester89 – 2016-08-02T13:31:20.610