config.sub quoting issue

Torbjorn Granlund tg at
Tue Oct 28 15:45:57 CET 2008

Sebastian Freundt <hroptatyr at> writes:

  Hey there,
  we've had a report regarding one of your build chain scripts, config.sub.
  Basic facts: NetBSD4, login shell is ksh, macharchos: sparc-sun-sunos4.1.1
  Basically this is what happens:
  [hf at Gstoder] /<2>sxemacs/sxemacs-22.1.9 > /bin/sh ./config.sub sun4
  [hf at Gstoder] /<2>sxemacs/sxemacs-22.1.9 > /bin/ksh ./config.sub sun4
  "./config.sub" not found
  [hf at Gstoder] /<2>sxemacs/sxemacs-22.1.9 > /usr/pkg/bin/bash ./config.sub sun4
  [hf at Gstoder] /<2>sxemacs/sxemacs-22.1.9 >
  we nailed it down to a quoting issue, config.sub:44
  configfsf_sub="`echo \"$0\" | sed 's/config.sub$/configfsf.sub/'`"
  our fix is to use the more quoting-tolerant $(...) syntax:
  configfsf_sub=$(echo "$0" | sed 's/config.sub$/configfsf.sub/')
I don't think you can expect that quoting style to work in
all /bin/sh out there, unfortunately.

Why do you explicitly use /bin/ksh, why don't you simply let the !# in
the file determine that interpreter to use?  Then things should work.


More information about the gmp-bugs mailing list