/media/sda-magnetic/david/david2/david2/bash/2022-09-17/execall.sh


#!/bin/bash 

l=$(ls)
a=(David Vajda Linux User Max Mustermann)

i=0
while [ $i -lt 6 ]
do
    for s in $l
    do
        if [ "$s" != "execall.sh" ]
        then 
            if [ "$s" != "out.txt" ]
            then 
                if [ "$s" == "ifthenelse.sh" ]
                then 
                    echo "##########################" >> out.txt
                    echo "### output $s" >> out.txt
                    echo "##########################" >> out.txt
                    echo "${a[$i]} ${a[$(($i+1))]}" | /bin/bash "$s" >> out.txt
                elif [ "$s" == "io.sh" ]
                then
                    echo "##########################" >> out.txt
                    echo "### output $s" >> out.txt
                    echo "##########################" >> out.txt
                    echo "${a[$i]} ${a[$(($i+1))]}" | /bin/bash "$s" >> out.txt
                else
                    echo "##########################" >> out.txt
                    echo "### output $s" >> out.txt
                    echo "##########################" >> out.txt
                    /bin/bash "$s" >> out.txt
                fi
            fi
        fi
    done
    i=$(($i+2))
done