A function from a larger script:
function lipo {
OUTDIR=$SDK_DIR/lib/$CONFIG
mkdir -p $OUTDIR
for LIBNAME in $SDK_DIR/lib/$CONFIG-iphoneos/lib*
do
BASELIBNAME=`basename $LIBNAME`
OUTLIB=$OUTDIR/$BASELIBNAME
echo lipo $BASELIBNAME for $CONFIG
lipo $SDK_DIR/lib/$CONFIG-iphoneos/$BASELIBNAME $SDK_DIR/lib/$CONFIG-iphonesimulator/$BASELIBNAME -create -output $OUTLIB
done
}
The target directory has a few files in it, in fact here is a real example:

When I run this function, this happens:

It just very quickly loops forever on the first file... (whole screen fills up in under 1s) the echo is being run but nothing else - this lipo operation takes a second or so so for it to loop dozens of times a second, it's not running. But no errors are given.
If I run the command on a single file by hand, it seems to work fine - or if I mess it up I get an error. So two questions really...
- Why is only the
echobeing run? - Regardless if the command succeeds, how can the loop keep repeating the first file in the directory forever?