[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
IFS=: breaks literal patterns with character classes
From: |
Enrique Perez-Terron |
Subject: |
IFS=: breaks literal patterns with character classes |
Date: |
Fri, 16 Oct 2009 16:20:04 +0200 |
Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i386'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-redhat-linux-gnu'
-DCONF_VENDOR='redhat' -DLOCALE
DIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H -I. -I.
-I./include -I./lib -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-O2
-g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
--param=ssp-buffer-size=4 -m32 -march=i586 -mtune=generic
-fasynchronous-unwind-tables
uname output: Linux apeiron.home.lan 2.6.29.4-167.fc11.i586 #1 SMP Wed May 27
17:14:37 EDT 2009 i686 i686 i386 GNU/Linux
Machine Type: i386-redhat-linux-gnu
Bash Version: 4.0
Patch Level: 23
Release Status: release
Description:
See the Repeat-by section. Character class [:graph:] appears not to
match as it
should, if IFS=':'. Why, or at what stage, is IFS used here?
Repeat-By:
$ # Correct:
$ (IFS=' '; case A in ([[:graph:]]) echo graph;; (*) echo non-graph;;
esac)
graph
$ # Not correct:
$ (IFS=':'; case A in ([[:graph:]]) echo graph;; (*) echo non-graph;;
esac)
non-graph
$ # Contrast with
$ (IFS=:; echo a:b)
a:b
$ # The error also happens with the == operator:
$ # Correct:
$ (IFS=' '; [[ A == [[:graph:]] ]] && echo yes || echo no)
yes
$ # Not correct
$ (IFS=':'; [[ A == [[:graph:]] ]] && echo yes || echo no)
no
- IFS=: breaks literal patterns with character classes,
Enrique Perez-Terron <=