Subject: Re: bmake and bootstrap and own.mk and MKCONF
To: None <tech-pkg@netbsd.org>
From: Klaus Heinz <k.heinz.okt.fuenf@onlinehome.de>
List: tech-pkg
Date: 10/09/2005 12:15:04
Simon J. Gerraty wrote:

> set -x
> X=one:two:three
> echo got `IFS=:; echo $X`; echo 
> echo got `(IFS=:; echo $X)`; echo 
> x=`IFS=:; echo $X`
> echo got $x; echo

UnixWare 7.1.1 (which probably has more bugs than more recent versions)
/bin/ksh:
  $ set -x
  $ + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  X=one:two:three
  + X=one:two:three
  $ + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  echo got `IFS=:; echo $X`; echo
  + IFS=:
  + echo one two three
  + echo got 'one two three'
  got one two three
  + echo
  
  $ + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  echo got `(IFS=:; echo $X)`; echo
  + IFS=:
  + echo one two three
  + echo got 'one two three'
  got one two three
  + echo
  
  $ + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  x=`IFS=:; echo $X`
  + IFS=:
  + echo one two three
  + x='one two three'
  $ + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  + eval ''
  echo got $x; echo
  + echo got one two three
  got one two three
  + echo
  
  $ 

The results above seem to be ok to me. It looks like for-loops (or some
interaction between for-loops and sub-shells) is broken:

/bin/ksh:
  $ X=one:two:three
  $ for d in `IFS=:; echo $X`; do echo $d; done
  one two three
  $ for d in `(IFS=:; echo $X)`; do echo $d; done
  one two three
  $ x=`IFS=:; echo $X`
  $ for d in $x; do echo $d; done
  one
  two
  three
  $ 

ciao
     Klaus