19 Apr
2002
19 Apr
'02
11:32 a.m.
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(a)l8s.co.uk