Browse Source

erste Scripts für Teil 11 (if)

master
Olli Graf 4 months ago
parent
commit
b1871443df
  1. 14
      teil11/and.sh
  2. 16
      teil11/else.sh
  3. 11
      teil11/linear.sh
  4. 14
      teil11/skip3rd.sh
  5. 11
      teil11/strings.sh

14
teil11/and.sh

@ -0,0 +1,14 @@
#and.sh
counter='1'
echo "${counter}"
let counter=counter+1
echo "${counter}"
let counter=counter+1
if [ ${counter} -eq 3 ] && [ ${counter} -gt 2 ]; then
echo "drei"
fi
let counter=counter+1
echo "${counter}"

16
teil11/else.sh

@ -0,0 +1,16 @@
#else.sh
counter='1'
echo "${counter}"
let counter=counter+1
echo "${counter}"
let counter=counter+1
if [ ${counter} -ne 3 ]; then
echo "${counter}"
else
echo "drei"
fi
let counter=counter+1
echo "${counter}"

11
teil11/linear.sh

@ -0,0 +1,11 @@
#linear.sh
counter='1'
echo "${counter}"
let counter=counter+1
echo "${counter}"
let counter=counter+1
echo "${counter}"
let counter=counter+1
echo "${counter}"

14
teil11/skip3rd.sh

@ -0,0 +1,14 @@
#skip3rd.sh
counter='1'
echo "${counter}"
let counter=counter+1
echo "${counter}"
let counter=counter+1
if [ ${counter} -ne 3 ]; then
echo "${counter}"
fi
let counter=counter+1
echo "${counter}"

11
teil11/strings.sh

@ -0,0 +1,11 @@
#strings.sh
string1='Skinner'
if [[ ${string1} == 'Skinner' ]]; then
echo "Es ist Skinner"
else
echo " Es ist nicht Skinner"
fi
Loading…
Cancel
Save