[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
${#parameter} confused by whitespaces
From: |
Al Elgert |
Subject: |
${#parameter} confused by whitespaces |
Date: |
Tue, 13 Aug 2002 19:30:52 +0200 |
User-agent: |
Mutt/1.4i |
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 pc12 2.4.18 #2 Tue Jul 30 12:24:27 CEST 2002 i686 unknown
unknown GNU/Linux
Machine Type: i686-pc-linux-gnu
Bash Version: 2.05b
Patch Level: 0
Release Status: release
Description:
${#parameter} does return the correct length, if there is
leading white space in $parameter.
The Problem does not appear under Solaris8.
Repeat-By:
Linux:
0 pc12 ~>uname -a; echo $BASH_VERSION
Linux pc12 2.4.18 #2 Tue Jul 30 12:24:27 CEST 2002 i686 unknown unknown
GNU/Linux
2.05b.0(1)-release
0 pc12 ~>x="abc"; echo "${#x}"
3
0 pc12 ~>x=" abc"; echo "${#x}"
-> 3
0 pc12 ~>
Solaris:
Configuration Information [Automatically generated, do not change]:
Machine: sparc
OS: solaris2.8
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='sparc'
-DCONF_OSTYPE='solaris2.8' -DCONF_MACHTYPE='sparc-sun-solaris2.8'
-DCONF_VENDOR='sun' -DSHELL -DHAVE_CONFIG_H -I. -I. -I./include -I./lib -g
-O2
uname output: SunOS ultra18 5.8 Generic_108528-13 sun4u sparc
SUNW,Sun-Blade-1000
Machine Type: sparc-sun-solaris2.8
0 ultra18 ~>uname -a; echo $BASH_VERSION
SunOS ultra18 5.8 Generic_108528-13 sun4u sparc SUNW,Sun-Blade-1000
2.05b.0(1)-release
0 ultra18 ~>x="abc"; echo "${#x}"
3
0 ultra18 ~>x=" abc"; echo "${#x}"
-> 4
0 ultra18 ~>
There are no $LC.. or $LANG Variables set.
greetings,
Alexander Elgert
--
Alexander Elgert
Public Gruppe
RechnerBetriebsGruppe TU Darmstadt (FB 20) Tel: +49 06151 16-4333
Raum: S1/13 11a (alt 25/11a)
FAQ2: http://www.informatik.tu-darmstadt.de/RBG/service/FAQ2/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- ${#parameter} confused by whitespaces,
Al Elgert <=