On Wed, 29 Nov 2006, Dan Uscatu wrote:
se da urmatorul program:
export a=0
cat file |
while read line
do
a=$(($a+1))
echo $a
done
echo $a
intrebare: de ce la sfirsit a este tot 0 ?
Pentru ca de aia. E alta instanta a shell-ului. Fa asa:
cat file | {
a=0;
while read line; do
a=$(($a+1));
echo $a;
done;
echo $a;
}
--
Any views or opinions presented within this e-mail are solely those of
the author and do not necessarily represent those of any company, unless
otherwise expressly stated.
_______________________________________________
RLUG mailing list
[email protected]
http://lists.lug.ro/mailman/listinfo/rlug