LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Adding variables then output to another variable (https://www.linuxquestions.org/questions/linux-newbie-8/adding-variables-then-output-to-another-variable-4175415313/)

stevo520 07-06-2012 05:06 PM

Adding variables then output to another variable
 
I need to figure out how to have 3 separate variables entered by the user, then added and output as a 4th variable?

pixellany 07-06-2012 05:20 PM

Take a look at the "read" command----going to dinner, can't help more ATM

pixellany 07-06-2012 07:06 PM

OK--here is a start:

Code:

while true; do
    read -p "enter a number" num
    echo "the number is" $num
done



All times are GMT -5. The time now is 02:40 AM.