![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Increment userid in file | dejavu88 | Shell Programming and Scripting | 2 | 05-26-2008 02:11 PM |
| Shell Script To increment Date*HElp*** | niceboykunal123 | Shell Programming and Scripting | 1 | 04-22-2008 10:05 PM |
| Increment date in 'for' loop? | SunnyK | Shell Programming and Scripting | 4 | 10-30-2007 03:12 AM |
| How to pattern match on digits and then increment? | sdutto01 | Shell Programming and Scripting | 2 | 08-11-2005 11:46 AM |
| Increment counter in ksh | steiner | Shell Programming and Scripting | 5 | 12-02-2003 05:10 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
increment...
hi,
i want to increment a Variable but it doesnt work. here my codé Code:
COUNT=1 COUNT= 'expr $COUNT + 1' expr: syntaxerror What does I make wrong? |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Use
Code:
count=1 count=$((count+1)) |
|
#3
|
|||
|
|||
|
thank you
now it works |
|
#4
|
|||
|
|||
|
be careful of spaces. You can't have spaces around =
COUNT=`expr $COUNT + 1` vinos method uses the bash specific syntax which will run faster as it doesn't need to start a seperate expr process per increment. |
|
#5
|
|||
|
|||
|
ok pixelbeat
thanks |
|||
| Google The UNIX and Linux Forums |