Browse Source

varname.sh calc.sh und constant.sh

master 1.0
Olli Graf 5 months ago
parent
commit
52838b8724
  1. 27
      teil10/calc.sh
  2. 6
      teil10/constant.sh
  3. 5
      teil10/varname.sh

27
teil10/calc.sh

@ -0,0 +1,27 @@
# calc.sh
a=5
b=10
# Summenbildung falsch
summe=a+b
echo "Summe falsch: ${summe}"
# Summenbildung korrekt
let c=a+b
echo "Summe: ${c}"
let d=b-a
echo "Differenz: ${d}"
e=$(expr ${a} \* ${b})
echo "Multiplikation: ${e}"
let f=b/a
echo "Division: ${f}"

6
teil10/constant.sh

@ -0,0 +1,6 @@
# constant.sh
readonly const=1
const=2

5
teil10/varname.sh

@ -0,0 +1,5 @@
var='var'
VAR='VAR'
echo ${VAR}
echo ${var}
Loading…
Cancel
Save