Please educate me
David Laight
david at l8s.co.uk
Fri Apr 19 05:32:49 CDT 2002
On Fri, Apr 19, 2002 at 04:13:03AM +0200, Sylvain Petreolle wrote:
> > noticed that
> >
> > for ac_dir in /sbin:/usr/sbin:$PATH
> >
> > was splitting as
> > 1. /sbin:/usr/sbin:/usr/local/bin
> > 2. /bin
> > 3. /usr/bin
> > etc.
>
> it's a normal behaviour, because for uses space as a
> separator, not ':' ??
>
> >
> > Now, I know I can force it to work by changing the
> > for loop to
> > for ac_dir in /sbin /usr/sbin $PATH
If you have:
more_path="/sbin:/usr/sbin:$PATH"
you can do:
save_ifs="$IFS"
IFS=" :"
for ac_dir in $more_path
do
IFS="$save_ifs"
...
done
So that the shell treats ':' as a separator when
parsing the output of the substitution.
David
--
David Laight: david at l8s.co.uk
More information about the wine-devel
mailing list