Company: Intuit_17_jan
Difficulty: medium
Problem Description In text-based instructions, arithmetic operations are often described with words mixed among numbers. This requires extracting the relevant mathematical data to perform calculations. Write a Bash script that reads lines of text from standard input. Each line represents an arithmetic instruction containing exactly one operator keyword ( sum , difference , multiply , or divide ) and exactly two integers ( num1 and num2 ). The script must: Identify the operator and the two numbers within the string, ignoring all unrelated words and characters. Perform the specified calculation ( num1 operator num2 ). Print the result of the calculation. Input Read from standard input ( stdin ). The input consists of multiple lines of text. Each line contains a mix of English words and exactly two integers. One of the words will be an operator: sum , difference , multiply , or divide . Output For each line of input, print the integer result of the operation on a new line to standard out