You've picked Compare
Pick a number
1
Pick another number
5
First Number is less then the Second Number
The answere is: <-- need to remove this
Press Enter to continue...

echo " \"Welcome\" to the most awsome calc evar"echo "1) Addition" #add two Numbersecho "2) Subtract" #subtract two numbersecho "3) Multiply" #multiply two numbersecho "4) Divide" #divide two numbersecho "5) Factorial" #Factorial two numbersecho "6) Campare" #Campare two numbersecho "7) EXIT" #exit the calculatorread CAL #get number for selection on CALCwhile [ $CAL != 7 ]#if CAL = to 7 will exit, if not continue next linedocase $CAL in #database arrays"1") echo "You've picked Additions" echo "Choose a number" read NUM1 echo "Choose a another number to add to the first number" read NUM2 VALUE=$(($NUM2+$NUM1)) ;;"2") echo "You've picked Subtract" echo "Choose a number" read NUM1 echo "Choose a another number to Subtract to the first number" read NUM2 VALUE=$(($NUM1-$NUM2)) ;;"3") echo "You've picked Multiply" echo "Choose a number" read NUM1 echo "Choose a another to multiply" read NUM2 VALUE=$(($NUM1*$NUM2)) ;;"4") echo "You've picked Divide" echo "Choose a number" read NUM1 echo "Choose a another to divide the first number" read NUM2 VALUE=$(($NUM1/$NUM2)) ;;"5") echo "You've picked Factorial" read NUM # get a number FOR=1 FOR=$(($FOR*$NUM)) # FOR TIME NUM NUM=$(($NUM-1)) # TAKE 1 OFF NUM FOR=$(($FOR*$NUM)) #FOR TIMES WITH NUM NUM=$(($NUM-1)) #TAKE 1 OFF NUM while [ $NUM -gt 1 ] # LOOP UNTIL NUM = 1 do FOR=$(($FOR*$NUM)) #times End by nu NUM=$(($NUM-1)) #takes 1 off NUM done ;;"6") echo "You've picked Compare" echo "Pick a number" #ask number read NUM1 #ask another number echo "Pick another number" read NUM2 if [ $NUM1 -eq $NUM2 ] #if NUM1 = NUM2 then echo "First Number is equal to Second Number" #show anwser NUM1=NUM2 else #orif [ $NUM1 -lt $NUM2 ] #NUM1 less less than NUM2then echo "First Number is less then the Second Number" #show answer A less Belseecho "First Number is Greater than Second Number" #or answer is A is Greater than Bfifi ;;*)echo "YOU ENTERED INVAILD OPTIONS"echo "PLEASE TRY AGAIN" ;;esac #show answerecho "The answere is: $VALUE"read -p "Press Enter to continue..." #pause for answereclear #spaceecho " \"Welcome\" to the most awsome calc evar"echo "1) Addition" #add two Numbersecho "2) Subtract" #subtract two numbersecho "3) Multiply" #multiply two numbersecho "4) Divide" #divide two numbersecho "5) Factorial" #Factorial two numbersecho "6) Campare" #Campare two numbersecho "7) EXIT" #exit the calculatorread CAL #get number for selection on CALCdone

Either delete line 82 or put a # sign in the first column to ignore the line altogether.

0

At Springboard, we know how to get you a job in data science. With Springboard’s Data Science Career Track, you’ll master data science with a curriculum built by industry experts. You’ll work on real projects, and get 1-on-1 mentorship from a data scientist.

Then you need to rewrite where the line is output. I get it, the example you have shown us does not add or subtract, it compares and gives the answer. You do not need the line "The Answer Is:" in this case but in other cases you do.

You could do this in a number of ways... Put the answer statement within the case section that needs it. This will require many duplicate line. Better way would be to place the lines in a subroutine that is called from with the case statements. I am certain I could come up with more...

Thanks technoweeb could you give an example on how id put the answere statement within the case section for each area? iv been trying but keep getting syntax errros

I Think its working =)
spent a while but it now does what i want it too do thanks for the hints

echo " \"Welcome\" to the most awsome calc evar"echo "1) Addition" #add two Numbersecho "2) Subtract" #subtract two numbersecho "3) Multiply" #multiply two numbersecho "4) Divide" #divide two numbersecho "5) Factorial" #Factorial two numbersecho "6) Campare" #Campare two numbersecho "7) EXIT" #exit the calculatorread CAL #get number for selection on CALCwhile [ $CAL != 7 ]#if CAL = to 7 will exit, if not continue next linedocase $CAL in #database arrays"1") echo "You've picked Additions" echo "Choose a number" read NUM1 echo "Choose a another number to add to the first number" read NUM2 VALUE1=$(($NUM2+$NUM1))echo "The answere is: $VALUE1"read -p "Press Enter to continue..." #pause for answere ;;"2") echo "You've picked Subtract" echo "Choose a number" read NUM1 echo "Choose a another number to Subtract to the first number" read NUM2 VALUE2=$(($NUM1-$NUM2))echo "The answere is: $VALUE2"read -p "Press Enter to continue..." #pause for answere ;;"3") echo "You've picked Multiply" echo "Choose a number" read NUM1 echo "Choose a another to multiply" read NUM2 VALUE3=$(($NUM1*$NUM2))echo "The answere is: $VALUE3"read -p "Press Enter to continue..." #pause for answere ;;"4") echo "You've picked Divide" echo "Choose a number" read NUM1 echo "Choose a another to divide the first number" read NUM2 VALUE4=$(($NUM1/$NUM2))echo "The answere is: $VALUE4"read -p "Press Enter to continue..." #pause for answere ;;"5") echo "You've picked Factorial" read NUM # get a number FOR=1 FOR=$(($FOR*$NUM)) # FOR TIME NUM NUM=$(($NUM-1)) # TAKE 1 OFF NUM FOR=$(($FOR*$NUM)) #FOR TIMES WITH NUM NUM=$(($NUM-1)) #TAKE 1 OFF NUM while [ $NUM -gt 1 ] # LOOP UNTIL NUM = 1 do FOR=$(($FOR*$NUM)) #times End by nu NUM=$(($NUM-1)) #takes 1 off NUM doneecho "And the answer is $FOR"read -p "Press Enter to continue..." #pause for answere ;;"6") echo "You've picked Compare" echo "Pick a number" #ask number read NUM1 #ask another number echo "Pick another number" read NUM2 if [ $NUM1 -eq $NUM2 ] #if NUM1 = NUM2 then echo "First Number is equal to Second Number" #show anwser NUM1=NUM2 else #orif [ $NUM1 -lt $NUM2 ] #NUM1 less less than NUM2then echo "First Number is less then the Second Number" #show answer A less Belseecho "First Number is Greater than Second Number" #or answer is A is Greater than Bfifiread -p "Press Enter to continue..." #pause for answere ;;*)echo "YOU ENTERED INVAILD OPTIONS"echo "PLEASE TRY AGAIN" ;;esac #end caseclear #spaceecho " \"Welcome\" to the most awsome calc evar"echo "1) Addition" #add two Numbersecho "2) Subtract" #subtract two numbersecho "3) Multiply" #multiply two numbersecho "4) Divide" #divide two numbersecho "5) Factorial" #Factorial two numbersecho "6) Campare" #Campare two numbersecho "7) EXIT" #exit the calculatorread CAL #get number for selection on CALCdone

Easiest way is to use a function so as to not repeat code.

Here's an example that shows how to use a function. As a bonus, I've fixed your spelling errors, corrected your indentation and fixed your factorial code.

#!/bin/bashfunction answer{ echo "The answer is: $1" read -p "Press Enter to continue..." }while truedo clear cat <<EOF"Welcome" to the most awesome calc ever1) Addition2) Subtract3) Multiply4) Divide5) Factorial6) Compare7) EXITEOF printf "Enter menu option: " read CAL case $CAL in 1) echo "You've picked Additions" printf "Choose a number: " read NUM1 printf "Choose a another number to add to the first number: " read NUM2 VALUE1=$(($NUM2+$NUM1)) answer $VALUE1 ;; 2) echo "You've picked Subtract" printf "Choose a number: " read NUM1 printf "Choose a another number to Subtract to the first number: " read NUM2 VALUE2=$(($NUM1-$NUM2)) answer $VALUE2 ;; 3) echo "You've picked Multiply" printf "Choose a number: " read NUM1 printf "Choose a another to multiply: " read NUM2 VALUE3=$(($NUM1*$NUM2)) answer $VALUE3 ;; 4) echo "You've picked Divide" printf "Choose a number: " read NUM1 printf "Choose a another to divide the first number:" read NUM2 VALUE4=$(($NUM1/$NUM2)) answer $VALUE4 ;; 5) echo "You've picked Factorial" printf "Choose the number to factorialize: " read NUM FACTORIAL=1 for (( i=$NUM; i>1; i-- )) do FACTORIAL=$(( $FACTORIAL * $i )) done answer $FACTORIAL ;; 6) echo "You've picked Compare" printf "Pick a number: " read NUM1 printf "Pick another number: " read NUM2 if [ $NUM1 -eq $NUM2 ] then echo "First Number is equal to Second Number" elif [ $NUM1 -lt $NUM2 ] then echo "First Number is less then the Second Number" else echo "First Number is Greater than Second Number" fi read -p "Press Enter to continue..." ;; 7) exit ;; *) echo "YOU ENTERED AN INVALID OPTION" echo "PLEASE TRY AGAIN" read -p "Press Enter to continue..." ;; esac done

So I am just curious... The last comment by the OP is that it was working.

I Think its working =)
spent a while but it now does what i want it too do thanks for the hints

The comment after that was from Tintin who did what I suggested and rewrote the script using a function (I said subroutine, basically accomplishing the same outcome). He also contributed to the script with some clean ups as well.

I have been a member here for a very long time and it seems that answering or completing homework assignments has always been frowned upon by EE Staff and Community. This question, as well as at least one previous question from the OP appear as homework assignments. I chose to not challenge that fact for this question but give a push in the right direction so the OP can learn what it is they obviously want to learn. I do not find that learning is accomplished by someone just doing the work for me. I also do not know for 100% certainty that this was a homework assignment. I could have just as easily re-written the assignment and sent the OP on his way, but this is not truly in the spirit of the EE site.

Are you ready to take your data science career to the next step, or break into data science? With Springboard’s Data Science Career Track, you’ll master data science topics, have personalized career guidance, weekly calls with a data science expert, and a job guarantee.

It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.

In part one, we reviewed the prerequisites required for installing SQL Server vNext.
In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.

Learn several ways to interact with files and get file information from the bash shell.
ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…