[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Cannot form valid test expressions that involve brackets as string compa
From: |
Lyall Pearce |
Subject: |
Cannot form valid test expressions that involve brackets as string comparison targets |
Date: |
Wed, 07 Oct 2009 20:07:19 +1030 |
User-agent: |
Thunderbird 2.0.0.23 (X11/20090911) |
Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: linux-gnu
Compiler: i686-pc-linux-gnu-gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i686'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu'
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash'
-DSHELL -DHAVE_CONFIG_H -I. -I. -I./include -I./lib
-DDEFAULT_PATH_VALUE='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
-DSTANDARD_UTILS_PATH='/bin:/usr/bin:/sbin:/usr/sbin'
-DSYS_BASHRC='/etc/bash/bashrc'
-DSYS_BASH_LOGOUT='/etc/bash/bash_logout' -DNON_INTERACTIVE_LOGIN_SHELLS
-DSSH_SOURCE_BASHRC -O2 -mtune=core2 -march=core2 -fomit-frame-pointer -pipe
uname output: Linux lyalls-pc 2.6.30-gentoo-r6 #1 SMP PREEMPT Sun Sep 6
10:18:42 CST 2009 i686 Intel(R) Core(TM)2 Quad CPU Q9400 @ 2.66GHz
GenuineIntel GNU/Linux
Machine Type: i686-pc-linux-gnu
Bash Version: 4.0
Patch Level: 28
Release Status: release
Description:
Cannot form expressions which involve left or right brackets.
Repeat-By:
basePic="(2008-04)"
if [ "${basePic:0:1}" = '(' -a "${basePic:4:1}" = ')' ]
then
echo "Got brackets"
fi
if [ "${basePic:0:1}" = "(" -a "${basePic:4:1}" = ")" ]
then
echo "Got brackets"
fi
if [ "${basePic:0:1}" = '\(' -a "${basePic:4:1}" = '\)' ]
then
echo "Got brackets"
fi
Fix:
Unsure, I think the bracket parsing should not be treated as
expression delimiters if they are enclosed in quotes?
If they are bare, then treat as (brackets), if enclosed in quotes,
treat as "data".
- Cannot form valid test expressions that involve brackets as string comparison targets,
Lyall Pearce <=