Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

create a shell script that uses if/else and other logical operators to determine

ID: 3764930 • Letter: C

Question

create a shell script that uses if/else and other logical operators to determine the larger of two numbers, and if two strings are equal.

For this exercise, the numbers and string values should be hard-wired into the code (e.g. INT1=12, INT2=14, STRING1 = "MOM", STRING2= "DAD")

Submit your shell script code, and the results of successfully running your code. Be sure to conduct and describe multiple test cases to ensure your script is working properly for a variety of numbers and string values.

You should submit both your code, and your word or PDF document with screen captures showing your results and descriptions and results for your multiple test cases.

Your document should be well-organized, well-written with minimal spelling and grammatical errors. The document should include page numbers, figure titles and numbers and section titles as appropriate.

Your code should include comments describing the code and header comments with your name, date and purpose of the script.

Explanation / Answer

INT1=12

INT2=14

STRING1 = "MOM"

STRING2= "DAD"

if test $ INT1-eq $ INT2

   then

      echo “numbers are equal”

   else

      echo “numbers are not equal”

fi

if test $STRING1 = $ STRING1

   then

      echo “strings are equal”

   else

      echo “strings are not equal”

fi