This is a discussion on script to add all numbers from 1 to 100 within the Shell scripting forums, part of the Development/Scripting category; Hi all, I want to write a script that adds up all the numbers from 1 to 100. I really ...
|
|||||||
| Register | FAQ | Members List | Calendar | Forgotten your password? | Mark Forums Read |
|
|||
|
Hi all,
I want to write a script that adds up all the numbers from 1 to 100. I really don't know how, but I know that this is not the right one and we have to use until loop only. Code:
x=1 until [ $x = 100 ] do echo x=$x y=`expr $x + 1` echo y=$y done Thanks, rc |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to check CPU Numbers in Linux | raj | Linux hardware | 1 | 06-17-2008 03:29 PM |
| pattern search with numbers | mercuryshipz | Coding in General | 0 | 02-15-2008 12:16 AM |
| Use float real numbers in a shell script | hao | Shell scripting | 1 | 03-16-2007 02:35 AM |
| Help with numbers | ricc | Shell scripting | 3 | 12-16-2006 07:48 PM |