bash20250318.sh


#!/bin/bash

name="Vajda"
vorname="David"

if [[ "$2" == "$name" && "$vorname" == "$1" ]]
then
    echo "Das bin ich"
elif [[ "$1" == "$name" && -z "$2" ]]
then
    echo "Das koennte ich sein"
else
    date
    echo "Hallo Welt"
    i=0
    while [ $i -lt 10 ]
    do
        echo "Hallo zum $(($i+1))."
        i=$(($i+1))
    done
    M=(a b c d)
    M+=(1 2 3 4)
    i=0
    j=0
    while [ $i -lt 2 ]
    do
        j=0
        while [ $j -lt 4 ]
        do
            echo "${M[$((4*$i+$j))]}"
            j=$(($j+1))
        done
        i=$(($i+1))
    done
    l=$(ls)
    i=0
    for s in $l
    do
        echo "$s"
        if [ $i -lt 8 ]
        then
            break
        fi
        i=$(($i+1))
    done
    /bin/bash "$0" "$vorname" "$name"
    /bin/bash "$0" "$name"
fi