M
M
Michael2020-02-17 14:43:24
linux
Michael, 2020-02-17 14:43:24

bash. How to remove the syntax error?

5e4a7baebbc3d445578794.png

Did the calculation of real numbers.
The terminal keeps throwing a syntax error.

Everything works fine, I do not understand what he is complaining about.
How to remove this error from the terminal?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
C
CityCat4, 2020-02-17
@CityCat4

Bash does not accept real numbers, only integers. Output the operation to some calculator and read data from it.

R
Radjah, 2020-02-17
@Radjah

$ echo 5.32/4.3 | bc -l
1.23720930232558139534

Z
zersh, 2020-02-18
@zersh

put the options in quotes
and treat them as arguments in the script
./cancul2.sh "$1" "$2" "$3"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question