bug-bash
[Top][All Lists]
Advanced

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

${#var} ignores leading spaces


From: chris
Subject: ${#var} ignores leading spaces
Date: Thu, 15 Aug 2002 22:52:51 -0400 (EDT)

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   -I.  -I. -I./include -I./lib -g -O2
uname output: Linux xword.rogers.com 2.4.18-6mdk #1 Fri Mar 15 02:59:08 CET 
2002 i686 unknown
Machine Type: i686-pc-linux-gnu

Bash Version: 2.05a  ## this is incorrect: $BASH_VERSION == 2.05b.0(1)-release
Patch Level: 0
Release Status: release

Description:
        The length of a variable obtained by expansion ${#var} is
        incorrect if the variable contains leading spaces. The leading
        spaces are ignored.

Repeat-By:

          $ q='qwerty'
          $ echo ${#q}
          6
          $ q='qwerty    '
          $ echo ${#q}
          10
          $ q='     qwerty    '
          $ echo ${#q}
          10





reply via email to

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