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
- /sbin:/usr/sbin:/usr/local/bin
- /bin
- /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