Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Korn shell arithmetic 1

Status
Not open for further replies.

FlashGorden

IS-IT--Management
Nov 8, 2001
22
0
0
EU
I need a counter in a ksh for loop but my syntax is wrong. All I need is a count= count+1.

Thanks
 
If you have something like ...

VAR=1

Then echo $VAR will show 1.

To increment it, you can say

VAR=`expr $VAR + 1`

Greg.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top