bash question
- From: Dario Lesca <d.lesca@xxxxxxxxxx>
- Date: Wed, 31 Oct 2007 14:12:37 +0100
In this shell script:
#!/bin/bash
i=0
printf "a a a\nb b b\nc c c\n" |
while read x
do
i=$[i+1]
echo "$x: ($i)"
done
echo $i
with this output:
a a a: (1)
b b b: (2)
c c c: (3)
0
How to I can get the value (3) for $i out of the while loop?
Many thanks
--
Dario Lesca <d.lesca@xxxxxxxxxx>
--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
- Follow-Ups:
- Re: bash question
- From: Jacques B.
- RE: bash question
- From: Miner, Jonathan W (CSC) (US SSA)
- Re: bash question
- Prev by Date: Re: Smolt - Hardware Database - Wiki
- Next by Date: RE: bash question
- Previous by thread: /sbin/ifup-local does not work on boot only on restart
- Next by thread: RE: bash question
- Index(es):
Relevant Pages
|