2025-06-04, bash20250528.sh

#!/bin/bash

# (C) David Vajda
# Bash skript uebung
# 2025 05 28

vorname="David"
nachname="Vajda"

if [[ "$1" == "$vorname" && "$2" == "$nachname" && -z "$3" ]]
then
    echo "Das bin ich"
elif [[ "$1" == "$vorname" && -z "$2" ]]
then
    echo "das koennte ich sein"
else
    date

    echo "David Vajda"
    echo "Hallo Welt"

    i=0
    while [ $i -lt 10 ]
    do
        echo "Hallo zum $(($i+1))."
        i=$(($i+1))
    done

    A=(aber hallo sage ich heute mal)
    A+=(aber genau auch das)

    i=0
    while [ $i -lt 10 ]
    do
        echo "${A[$i]}"
        i=$(($i+1))
    done

    for s in "${A[@]}"
    do
        echo "$s"
    done

    l=$(ls)
    i=0
    for s in $l
    do
        echo "$s"
        i=$((($i+1)%8))
        if [ $i -eq 0 ]
        then
            break
        fi
    done

    /bin/bash "$0" "$vorname" "$nachname"
    /bin/bash "$0" "$vorname"
fi