[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Autoconf build targets



On Mon, May 20, 2002 at 03:24:24PM -0400, Nathan Hawkins <utsl@quic.net> was heard to say:
> Daniel Burrows wrote:
> >On Mon, May 20, 2002 at 02:43:28PM -0400, Nathan Hawkins <utsl@quic.net> 
> >was heard to say:
> >>skaro:/dev# /sbin/MAKEDEV all
> >>MAKEDEV: line 1292: syntax error near unexpected token `)'
> >>MAKEDEV: line 1292: `   )'
> >
> >
> >  What does line 1292 look like?  This sounds like a possible bash or
> >ash bug to me.. (not sure which)
> 
> Might be, I don't know. The message about line 1292 repeats quite a few 
> times. It won't work on Linux, even with ash, because the device numbers 
> are much too large, but you can see what it does with bash.

  It seems that bash doesn't like $( ... ) with a "case" statement
inside it, since the case statement requires a ).  Probably the solution
is to convert the whole thing to s-expressions. *runs away quickly*

  More seriously, does anyone know what POSIX says should happen here?
I've Cced the bash and ash maintainers in case they have suggestions.

  I've attached a trivial program that exhibits the problem -- it
should do something utterly pointless in ash, and fail to compile in
bash.

  I don't think this is practical for you, but replacing the $(...) with
backquotes will work in this particular case (unless, of course, the
subshell wants to use $(...) inside a case statement itself -- maybe you
can backslash-escape the `s or something similarly horrible, dunno)

  One other note: if I backslash-escape the case statement's ")", bash
likes the program and ash doesn't.

  Daniel

-- 
/-------------------- Daniel Burrows <dburrows@debian.org> -------------------\
|                   "He is so predictable, we could emulate                   |
|                    him with a two-state Turing Machine."                    |
\----------------- The Turtle Moves! -- http://www.lspace.org ----------------/
#!/bin/bash

case $1 in
x)
  case $2 in
    y)
      echo $(for x in *; do
          case $x in
	    a)
	      echo $x
	      ;;
	  esac
         done
         )
      ;;
    z)
      echo baz
      ;;
    esac
  ;;
y)
  echo frobozz
  ;;
esac

Reply to: