This is the shellchecked and updated code. I would be very grateful for any help! More specifically, the code will either not run, or it will run but it will return an error message, and I will be unable to enter any numbers that will be the price of a meal. The error message that pops up when I attempt to run the code is: stinput: command not found and then : command not found which repeats twice. Update: I tried the code the way that user down below suggested so this is the updated code and the error message:
#!/bin/bash NumberofInputs="$1" total=$(( $1 * $2)) total=$(("$total" / 100)) total=$(("$total" + $3 + "$NumberofInputs")) echo "The price of the meal is: $1" echo "The tax for the meal is: $2" echo "The tip for the meal is: $3" echo "The total amount paid is: $total" exit 1 UPDATE: When I remove the first part of user000001 code, I get this error: bash: * : syntax error: operand expected (error token is "* ") bash: "" / 100: syntax error: operand expected (error token is """ / 100") bash: "" + + : syntax error: operand expected (error token is """ + + ") But when I leave the 1st part of user000001's code in, I get this error message: echo I'm sorry, that is incorrect, please enter only 3 parameters.: command not found
UPDATE: I figured out the answer, it was removing the quotations and spacing all the variables together. Thank you to everyone for your help!
$1stinput,$2ndinputetc? What do you mean it "either not runs, or runs with errors"? Which one is it? What errors do you get?