space char shell script problem
roberthuff at rcn.com
Sat Aug 23 13:08:18 UTC 2008
> > I am running into a problem with the space character in filenames.
> > For instance, If I want to run the script;
> > for x in `ls`
> > do
> > echo $x
> > done
> for x in *
There's the (poorly documented, IMO) IFS (internal field
separator) shell variable. It's a string, normally set to space and
tab; set it to newline and good things can happen.
More information about the freebsd-questions