False alarm (was Re: [BusyBox] Shell bug, or my snafu?)

Charlie Brady charlieb-busybox at e-smith.com
Thu Mar 25 16:37:17 UTC 2004


On Thu, 25 Mar 2004, Charlie Brady wrote:

> I'm tweaking IFS for "on-the-cheap" parsing of filenames. But IFS seems to 
> be being munged inside variable values. If I'm making a dumb mistake, 
> please point it out to me.

Seems to have been a version control problem on my end. I wasn't running 
the code I thought I was.

Here's a short test case, and runs as expected.

#! /bin/sh

set -x
mkdir foo
touch foo/one-two
IFS=-
ls foo | while read one two
do
   FILE="foo/$one-$two"
   if [ \! -f "$FILE" ]
   then
       echo file "$FILE" not found
   else
       echo file "$FILE" found
   fi
done

--
Charlie




More information about the busybox mailing list