Операционная система Linux


Пример 8.16


[methody@localhost methody]$ A=8; B=6

[methody@localhost methody]$ expr $A + $B

14

[methody@localhost methody]$ echo "$A + $B = `expr $A + $B`"

8 + 6 = 14

[methody@localhost methody]$ A=3.1415; B=2.718

[methody@localhost methody]$ echo "$A + $B = `expr $A + $B`"

expr: нечисловой аргумент

3.1415 + 2.718 =

[methody@localhost methody]$ echo "$A + $B" | bc

5.8595

[methody@localhost methody]$ C=`echo "$A + $B" | bc`

[methody@localhost methody]$ echo "$A + $B = $C"

3.1415 + 2.718 = 5.8595




Начало  Назад  Вперед



Книжный магазин