bug-bash
[Top][All Lists]
Advanced

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

strange behavior


From: Ruud Baart
Subject: strange behavior
Date: Fri, 7 Jun 2002 12:38:05 +0200

Version bash: GNU bash, version 2.05.0(1)-release (i386-suse-linux)
System: SuSE Linux 7.2

Very simple shell script "showlines":
#
# next line makes no difference
#declare -ix COUNTER
#
let COUNTER=0
echo -e "line a\nline b\nline c"|while read LINE
do
   let COUNTER++
   echo "$COUNTER: $LINE"
done
echo "\$COUNTER=$COUNTER"

Results:
bash showlines
1: line a
2: line b
3: line c
$COUNTER=0

However executing the same script with zsh gives a different result
zsh showlines
1: line a
2: line b
3: line c
$COUNTER=3

which makes much more sense to me. Bug?

Met vriendelijke groet/Regards,
Prompt
R.J. Baart

Marktveldpassage 35c
5261 ED Vught
Netherlands
Mailto:address@hidden
Http://WWW.Prompt.NL
Tel.: +31 73 6567041                          
Fax.: +31 73 6573513




reply via email to

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