| Well, here is the relevant ChangeLog entry:
| 
| Thu Feb  2 11:32:07 1995  David J. MacKenzie  <[EMAIL PROTECTED]>
| 
|         * acgeneral.m4 (AC_CACHE_SAVE): Workaround Ultrix and 4.3BSD sh
|           bug in setting the high bit on variable values.
|           From Ken Raeburn.
| 
| Ken Raeburn is [EMAIL PROTECTED], if you want to ask him about it.

Yep, thanks.  I had found the ChangeLog entry, asked him, but had no
reply. 

| I can replicate this bug on Ultrix with this shell script:
| 
| rm -f foo.cache
| ac_cv_path_M4=/usr/bin/m4
| (set) 2>&1 |
|   sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/: \${\1='\2'}/p" \
|   >> foo.cache
| /bin/sh -c '
|   . foo.cache
|   echo $ac_cv_path_M4
|   (set) 2>&1 |
|     sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/: \${\1='"'"'\2'"'"'}/p" \
|     >> foo.cache
|   echo $ac_cv_path_M4
|   cat -v foo.cache'
| 
| On Ultrix, the output is this:
| 
| /usr/bin/m4
| /usr/bin/m4
| : ${ac_cv_path_M4='/usr/bin/m4'}
| : ${ac_cv_path_M4='M-/M-uM-sM-rM-/M-bM-iM-nM-/M-mM-4'}

Aaaaaaaah, OK.  I thought the ChangeLog meant the 8th bit was not
*preserved*.  And I could not find a valid explanation to understand
why it would preserve something to assign twice instead of once :)

| This bug does not happen if I change the use of /bin/sh in the script
| to /bin/sh5, and invoke the script with /bin/sh5.  In that case, I see
| this:
| 
| /usr/bin/m4
| /usr/bin/m4
| : ${ac_cv_path_M4='/usr/bin/m4'}
| : ${ac_cv_path_M4='/usr/bin/m4'}

OK, thanks!

| Note that the ChangeLog entry indicates that this bug arises on the
| 4.3BSD shell as well.  The BSD shells used to use the high bit to
| record information--that is, they were not eight bit clean.  

Not being 8 bit clean is something I can understand.  Here I wouldn't
call it even 7 bits clean.


| This was
| a problem with csh in particular for years.  I'm pretty certain that
| 4.3BSD did not have a second shell like the Ultrix /bin/sh5.  On the
| other hand, I don't know whether anybody still runs 4.3BSD.

On AIX the solution is bsh.  I don't understand the point of having
several Bourne shells actually.


| That is correct: there are no shells on those machines which support
| functions.  In those days machines only had one shell.  Ultrix only
| has two shell programs because it is trying to merge BSD and Sysem V;
| /bin/sh is the BSD shell, and /bin/sh5 is the System V shell.  Having
| two shells is just a holdover from the BSD/System V split.  Presumably
| modern systems drop the two shells as they become POSIX.2 compliant.

This answers the previous question, and I guess it explains the `b' of
`bsh'.

| SVR2 came out in 1984.  Eunice is a Unix simulator which runs on VMS.
| A little net spelunking reveals that it was around in 1982.

Hm, pretty comparable, but the difference is probably that there are
few VMS machines today.

| I just checked Horton's Portable C Programming.  He says ``There have

What is it?  A book?

| been some features added to the Bourne shell since V7 that are not
| portable.  These include the : operator used with parameter expansion:
| ${x:-y} and the use of # for comments.  Systems derived from V7, such
| as 4BSD, do not support these features.  The test or [ commands also
| vary from system to system.''

OK.  Thanks a lot Ian, the cache syntax has been a mystery to me for a
long time.

        Akim

Reply via email to