Also, arithmetische Rechnungen sind mit Bash ja kein Problem, z.B. so:
Code: Select all
dominik@trinity:~$ echo $((100 / 5))
20Code: Select all
dominik@trinity:~$ echo $((100 / 67))
1Code: Select all
ARITHMETIC EVALUATION
The shell allows arithmetic expressions to be evaluated,
under certain circumstances (see the let builtin command
and Arithmetic Expansion). Evaluation is done in long
integers with no check for overflow, though division by 0
is trapped and flagged as an error. The operators and
their precedence and associativity are the same as in the
C language. The following list of operators is grouped
into levels of equal-precedence operators. The levels are
listed in order of decreasing precedence.
Oder kennt hier jemand eine Möglichkeit, das mit der Bash zu machen?
Wäre nämlich nicht schlecht, sonst muss ich mein ganzes Skript in Perl nochmal neu schreiben...