bug-bash
[Top][All Lists]
Advanced

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

case-esac syntax rejected in command substitution, acepted otherwise


From: Enrique Perez-Terron
Subject: case-esac syntax rejected in command substitution, acepted otherwise
Date: Thu, 22 Jul 2004 22:53:53 +0200

Hello,

I wonder if this is a known bug or "feature":

With backticks, this works wonderfully:

  $ echo `case hello in *) echo hello;; esac`
  hello

But with the $() syntax:

  $ echo $(case hello in *) echo hello;; esac)
  bash: syntax error near unexpected token `;;'

This must be an incorrect parsing, where the right banana in the case
statement label delimiter is taken to be the terminator of the command
substitution.

Other information about my system:

  $ echo $BASH_VERSION
  2.05b.0(1)-release

  $ rpm -qf /bin/bash
  bash-2.05b-38

I run Fedore Core 2 on an AMD K6 under 

  $ uname -a
  Linux arabia.home.lan 2.6.6-1.435.2.3 #1 Thu Jul 1 09:11:28 EDT 2004 
  i586 i586 i386 GNU/Linux

and I have
  $ ldd /bin/bash
        linux-gate.so.1 =>  (0x0035b000)
        libtermcap.so.2 => /lib/libtermcap.so.2 (0x00d01000)
        libdl.so.2 => /lib/libdl.so.2 (0x0073d000)
        libc.so.6 => /lib/libc.so.6 (0x004c0000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x00139000)

  $ rpm -qf /lib/libc.so.6
  glibc-2.3.3-27

Please mail me if any more information is needed.

Regards,
Enrique





reply via email to

[Prev in Thread] Current Thread [Next in Thread]