Most Difficult Question EVER!!



I am working in the bourne shell and need some help understanding this
output

here is what is in will.ftp
-----------------------------------------------------
NonEmptyFiles=
NonEmptyFiles="$NonEmptyFiles $(ls *.phy| xargs -i bash -c 'test -s
{}
&& echo {}')"
for EachFile in "$NomEmptyFiles"
do
echo "Test"
done
-----------------------------------------------------


the direcotry containing will.ftp has 01.phy and 02.phy both 1Kb


When i run will.ftp I get:
Test


I would think that I would get:
Test
Test


If i switch will.ftp to be:
------------------------------------------------------
NonEmptyFiles=
NonEmptyFiles="$NonEmptyFiles $(ls *.phy| xargs -i bash -c 'test -s
{}
&& echo {}')"
echo "$NonEmptyFiles"
#for EachFile in "$NomEmptyFiles"
#do
# echo "Test"
#done
------------------------------------------------------


When i run will.ftp with the code directly above i do get:
01.phy
02.phy


so the command to populate $NonEmptyFiles appears to be working


it is odd that in the results 01.phy has a space in front of it


Why am i not getting?:
Test
Test


Thanks,
Will

.



Relevant Pages