You have created a script that performs arithmetic calculations on two numbers entered by the user.
After running the script, you get the “non-integer argument” message.
What steps would you need to take to debug this script?
The first step is to check if the read command is used correctly for getting two numbers from the user. If not fix the syntax for the read command
The second step is to check if the variables storing the two numbers have valid names and are accessed correctly using the $ sign. If not, rename the variables using valid characters and use the $ sign in front of the variable names when accessing them.
The third step is to check if the command and arithmetic operators are used correctly for calculating the two numbers. If not, fix the syntax for expr command and only use the ‘+ - * / %’ operators for calculating the two numbers.
The fourth step is to check if regular expressions are used correctly to validate the variables containing any non-numerical values entered by the user. If not, the “^-?[0-9]+$” regular expression must be used inside the IF statement to check if the variables only contain numerical values entered by the user.