Re: Bash Excersize

#!/bin/bash

l=\$(ls)

for s in \$l
do
    if [ "\$s" != "all.sh" ]
    then
        if [ "\$s" != "out.txt" ]
        then
            if [ "\$s" == "ifthenelse.sh" ]
            then
                echo "David Vajda" | /bin/bash "\$s" >> out.txt
            elif [ "\$s" == "io.sh" ]
            then
                echo "David Vajda" | /bin/bash "\$s" >> out.txt
            else
                /bin/bash "\$s" >> out.txt
            fi
        fi
    fi
done


for s in \$l
do
    if [ "\$s" != "all.sh" ]
    then
        if [ "\$s" != "out.txt" ]
        then
            if [ "\$s" == "ifthenelse.sh" ]
            then
                echo "Tux User" | /bin/bash "\$s" >> out.txt
            elif [ "\$s" == "io.sh" ]
            then
                echo "Tux User" | /bin/bash "\$s" >> out.txt
            else
                /bin/bash "\$s" >> out.txt
            fi
        fi
    fi
done


for s in \$l
do
    if [ "\$s" != "all.sh" ]
    then
        if [ "\$s" != "out.txt" ]
        then
            if [ "\$s" == "ifthenelse.sh" ]
            then
                echo "Max Mustermann" | /bin/bash "\$s" >> out.txt
            elif [ "\$s" == "io.sh" ]
            then
                echo "Max Mustermann" | /bin/bash "\$s" >> out.txt
            else
                /bin/bash "\$s" >> out.txt
            fi
        fi
    fi
done
#!/bin/bash

a=(Hallo sagt David Vajda)
a+=(aber das auch)

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

i=1
while [ \$i -le 7 ]
do
    echo "\${a[\$((\$i-1))]}"
    i=\$((\$i+1))
done
 #!/bin/bash

 l=\$(ls)

 for s in \$l
 do
    if [ "\$s" != "out2.txt" ]
    then
        if [ "\$s" != "gartenzaun.txt" ]
        then
            cat "\$s" >> out2.txt
            cat "gartenzaun.txt" >> out2.txt
        fi
    fi
 done
#!/bin/bash

l=\$(ls)

for s in \$l
do
    echo \$s
done
#!/bin/bash

read -p "Geben Sie ihren Namen ein: " name
echo "\$name"

if [ "\$name" == "David Vajda" ]
then
    echo "Sie sind ich"
elif [ "\$name" == "Tux User" ]
then
    echo "Sie sind Linux User"
else
    echo "Ueber Sie sind keine Informationen bekannt"
fi
#!/bin/bash

read -p "Geben Sie ihren Namen ein: " name
echo "\$name"
#!/bin/bash

echo "#!/bin/bash"
#!/bin/bash

i=0

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