![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Simple addition, help. | Bandit390 | Shell Programming and Scripting | 3 | 09-23-2008 11:46 AM |
| addition | email-lalit | Shell Programming and Scripting | 2 | 08-06-2008 02:58 PM |
| Addition problem | onlyroshni | Shell Programming and Scripting | 2 | 12-10-2007 11:11 AM |
| How to perform addition of two numbers in shell scripting in Solaris-10 | krevathi1912 | SUN Solaris | 9 | 11-29-2007 06:36 AM |
| floating point addition | ravi raj kumar | Shell Programming and Scripting | 8 | 12-21-2006 11:47 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
addition in sh shell
I have to create un counter and I am unable to do an additition:
#!/bin/sh count=$1 while [[ $count -le 10]] do echo $count $count=$count+$1 done |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
The [[ ... ]] test command is not portable with all shell versions, try this:
Code:
#!/bin/sh count=$1 while [ "$count" -le 10 ] do echo "$count" let count="count+$1" done Regards |
|||
| Google The UNIX and Linux Forums |