bug-bash
[Top][All Lists]
Advanced

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

offset error for IFS=$'\n' and "${A[@]##x*}"


From: Lars Ellenberg
Subject: offset error for IFS=$'\n' and "${A[@]##x*}"
Date: Wed, 18 Dec 2002 20:14:39 +0100 (CET)

Configuration Information [Automatically generated, do not change]:
Machine: i586
OS: linux
Compiler: gcc -I/usr/src/packages/BUILD/bash-2.05b
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i586' 
-DCONF_OSTYPE='linux' -DCONF_MACHTYPE='i586-suse-linux' -DCONF_VENDOR='suse' 
-DSHELL -DHAVE_CONFIG_H  -I.  -I. -I./include -I./lib  -O2 -march=i586 
-mcpu=i686 -fmessage-length=0 -D_GNU_SOURCE -Wall -pipe -g
uname output: Linux minna 2.4.19-4GB #1 Wed Nov 27 00:56:40 UTC 2002 i686 
unknown
Machine Type: i586-suse-linux

Bash Version: 2.05b
Patch Level: 0
Release Status: release

Description:
        see below

Repeat-By:

This bash code
  A=$'1 qwer asdf yxcv\n2 qwer asdf yxcv\n3qwer asdf yxcv\n4 qwer asdf yxcv'
  IFS=$'\n'
  B=($A)
  echo "${B[@]##1*}"
  echo "${B[@]##2*}"
  echo "${B[@]##[1-3]*}"

generates exactly the following output:

  22  qqwweerr  aassddff  yyxxccv  33qqwweerr  aassddff  yyxxccv  44  qqwweerr  
aassddff  yyxxccv
1 qwer asdf yxcv   33qqwweerr  aassddff  yyxxccv  44  qqwweerr  aassddff  
yyxxccv
    4  4q wqewre ra sadsfd fy xycxv


-- 
Cheers,
        Lars



reply via email to

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