Most Difficult Question EVER!!
- From: "Will" <wisaunders@xxxxxxxxx>
- Date: 28 Mar 2007 11:30:24 -0700
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
.
- Follow-Ups:
- Re: Most Difficult Question EVER!!
- From: Chris F.A. Johnson
- Re: Most Difficult Question EVER!!
- Prev by Date: Re: vi error
- Next by Date: Re: vi error
- Previous by thread: Sed: removing XML headers
- Next by thread: Re: Most Difficult Question EVER!!
- Index(es):
Relevant Pages
|
|