Need Help with a "while" loop
Hi,
I need some help with looping. I need a portion of a script where I ask for two numbers to be entered, which also continue to ("while") loop until "q" is pressed to quit the loop. The numbers are ultimately added, but what I am looking for is that I need the two numbers that are entered to be looped. Here is my present script (below) which adds two numbers. Please be gentle as I am truly "a newbie." Thank You, joe. echo "Enter one number" read num1 echo “Enter another number” read num2 sum=$((num1 + num2)) echo "The sum is = $sum" |
you did'nt mentioned how the no's are looped, so considering this is not your school assignment, let me give you a usage of while loop so you try looping your variables the way you want them and let us know where you stuck.
syntax: Code:
while [condition] cheers :) |
Like SAbhi wrote above, it's not really clear what you are trying to achieve here. I honestly don't understand your question, specifically:
Quote:
Best of luck, and get back with more info, then we might be able to help out. HMW |
All times are GMT -5. The time now is 02:56 PM. |