Leser: 11
1
2
3
4
5
$ declare -i n1 n2
$ n1=3+4*5
$ n2=(3+4)*5
$ if (("$n1" < "$n2")); then echo "number $n1 is smaller with the difference of 12 from $n2" ; fi
number 23 is smaller with the difference of 12 from 35
1
2
3
4
5
$ if (("$n1" < "$n2")); then echo "number $n1 is smaller with the difference of 12 from $n2" ; else echo "$n2 is larger than $n1" ; fi
number 23 is smaller with the difference of 12 from 35
$ n1=$n2 ; n2=$n1
$ if (("$n1" < "$n2")); then echo "number $n1 is smaller with the difference of 12 from $n2" ; else echo "$n2 is larger than $n1" ; fi
[b]35 is larger than 35
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#! /bin/bash
a="foo"
b="bar"
echo "$a $b"
# tausche klassisch
c="$a"
a="$b"
b="$c"
echo "$a $b"
# optionales aufraeumen
unset c