I request primary focus on these two points first please.
How should I read that for statement?. The behavior appears to expect a list of files.
And what is the purpose of the 1>&2 in the statement
echo 1>&2 "$i some text"
And now for additional complexity.
The function is called later in the script and looks like this:
Code:
ftmatspresortlist=`getInputFiles "$TMATS_PRE_SORTED" ""`
The single quotes are from the top left key to the left the number one key, not the standard that is shared with double quotes. When that line is added to the script to call the function then most of the echos in the function are suppressed. Including the first echo before the for loop. (see the edits in the OP that added a few echos.) When the calling function is changed to:
Code:
getInputFile "$TMATS_PRE_SORTED"
All the echoes work again.
I am confused.
Edit 1:
Even more confused. When using the more simple function call, and just putting a variable to capture the return value, that causes all the echos in the function to no longer echo to the screen. That seems reasonable. Maybe it will echo to the return value.
Except
The variable to catch the return value is unchanged.
Code:
ftmatspresortlist="default"
ftmatspresortlist=getInputFiles "$TMATS_PRE_SORTED"
echo "ftmatspresortlist = $ftmatspresortlist"
and "default" is output.
Please bear in mind that I am a Linux and Bash novice.
Edit
there is something funky that might be related. I have posted that question here:
https://www.linuxquestions.org/quest...15#post5898415