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


#!/bin/bash 

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

outfile=out.sh
rm $outfile

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