[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bash 2.05a appears to mishandle comments within $()
From: |
ian |
Subject: |
bash 2.05a appears to mishandle comments within $() |
Date: |
4 Jun 2003 18:57:13 -0000 |
Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i686'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu'
-DCONF_VENDOR='pc' -DSHELL -DHAVE_CONFIG_H -D_GNU_SOURCE -I. -I. -I./include
-I./lib -O2 -march=i386 -mcpu=i686
uname output: Linux gossamer.airs.com 2.4.18-27.7.x #1 Fri Mar 14 06:44:53 EST
2003 i686 unknown
Machine Type: i686-pc-linux-gnu
Bash Version: 2.05a
Patch Level: 0
Release Status: release
Description:
bash 2.05a appears to mishandle comments within $(). I looked at the
NEWS for bash 2.05b, and didn't see a fix. However, I didn't actually
test 2.05b.
Repeat-By:
This example is straight from the IEEE Std 1003.2-1992 rationale,
section E.3.6.3.
echo $(
echo abc # a comment with )
)
This is supposed to simply print "abc". With bash 2.05a, I get
abc
/home/ian/foo.sh: line 4: syntax error near unexpected token `)'
/home/ian/foo.sh: line 4: `)'
Evidently bash is not simply ignoring the comment within the command
substitution, as it should.
Note that when using backquote substitution, the occurrence of a
backquote in a comment is undefined. The same is not true of the
occurrence of a close parenthesis in a comment when using $()
substitution.
This works correctly with the version of ash distributed with NetBSD
1.6.1.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- bash 2.05a appears to mishandle comments within $(),
ian <=