Fr 26. Sep 10:59:59 CEST 2025/sh092425.sh

#!/bin/bash

# (c) David Vajda
# 09/24/25
# std excersize

date

dividend=10
divisor=2

a1=$(($1))
a2=$(($2))

if [[ -n "$1" && -n "$2" && $(($a1%$dividend)) -eq 0 && $(($a2%$divisor)) -eq 0 && -z "$3" ]]
then
    echo "yes, the first argument can be diveded by 10"
    echo "yes, the second argument can be diveded by 2"
    x=$(($a1/$a2))
    echo "$a1 div $a2 = $x"
    exit
fi

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

M=("This" "is" "a" "text" "packed" "in" "an" "array" "and" "will" "put" "out" "word" "by" "word")
i=0
while [ $i -lt ${#M[@]} ]
do
    echo "${M[$i]}"
    i=$(($i+1))
done

for s in "${M[@]}"
do
    echo -n "$s "
done

echo "ok..."

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

/bin/bash "$0" 20 4