##########################
### file array.sh
##########################
#!/bin/bash
a=(Hallo sagt David Vajda)
a+=(aber auch das)
for s in "${a[@]}"
do
echo "$s"
done
i=0
while [ $i -lt 7 ]
do
echo "${a[$i]}"
i=$(($i+1))
done
##########################
### file catall.sh
##########################
#!/bin/bash
l=$(ls)
for s in $l
do
if [ "$s" != "outall.txt" ]
then
echo "##########################" >> outall.txt
echo "### file $s" >> outall.txt
echo "##########################" >> outall.txt
cat "$s" >> outall.txt
fi
done
##########################
### file cmd.sh
##########################
#!/bin/bash
l=$(ls)
for s in $l
do
echo "$s"
done
##########################
### file 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
##########################
### file ifthenelse.sh
##########################
#!/bin/bash
read -p "Geben Sie ihren Namen ein: " name
echo "$name"
if [ "$name" == "David Vajda" ]
then
echo "Sie haben denselben Namen wie der Autor des Skripts"
elif [ "$name" == "Linux User" ]
then
echo "Auf jeden Fall sind sie an der Nutzung von Linux interessiert"
else
echo "Wir wissen es nicht"
fi
##########################
### file io.sh
##########################
#!/bin/bash
read -p "Geben Sie ihren Namen ein: " name
echo "$name"
##########################
### file out.txt
##########################
##########################
### output array.sh
##########################
Hallo
sagt
David
Vajda
aber
auch
das
Hallo
sagt
David
Vajda
aber
auch
das
##########################
### output cmd.sh
##########################
array.sh
cmd.sh
execall.sh
ifthenelse.sh
io.sh
out.txt
shebang.sh
variable.sh
while.sh
##########################
### output ifthenelse.sh
##########################
David Vajda
Sie haben denselben Namen wie der Autor des Skripts
##########################
### output io.sh
##########################
David Vajda
##########################
### output shebang.sh
##########################
#!/bin/bash
##########################
### output variable.sh
##########################
Hallo
Hallo Welt
Hallololo
##########################
### output while.sh
##########################
Hallo zum 1.
Hallo zum 2.
Hallo zum 3.
Hallo zum 4.
Hallo zum 5.
Hallo zum 6.
Hallo zum 7.
Hallo zum 8.
Hallo zum 9.
Hallo zum 10.
##########################
### output array.sh
##########################
Hallo
sagt
David
Vajda
aber
auch
das
Hallo
sagt
David
Vajda
aber
auch
das
##########################
### output cmd.sh
##########################
array.sh
cmd.sh
execall.sh
ifthenelse.sh
io.sh
out.txt
shebang.sh
variable.sh
while.sh
##########################
### output ifthenelse.sh
##########################
Linux User
Auf jeden Fall sind sie an der Nutzung von Linux interessiert
##########################
### output io.sh
##########################
Linux User
##########################
### output shebang.sh
##########################
#!/bin/bash
##########################
### output variable.sh
##########################
Hallo
Hallo Welt
Hallololo
##########################
### output while.sh
##########################
Hallo zum 1.
Hallo zum 2.
Hallo zum 3.
Hallo zum 4.
Hallo zum 5.
Hallo zum 6.
Hallo zum 7.
Hallo zum 8.
Hallo zum 9.
Hallo zum 10.
##########################
### output array.sh
##########################
Hallo
sagt
David
Vajda
aber
auch
das
Hallo
sagt
David
Vajda
aber
auch
das
##########################
### output cmd.sh
##########################
array.sh
cmd.sh
execall.sh
ifthenelse.sh
io.sh
out.txt
shebang.sh
variable.sh
while.sh
##########################
### output ifthenelse.sh
##########################
Max Mustermann
Wir wissen es nicht
##########################
### output io.sh
##########################
Max Mustermann
##########################
### output shebang.sh
##########################
#!/bin/bash
##########################
### output variable.sh
##########################
Hallo
Hallo Welt
Hallololo
##########################
### output while.sh
##########################
Hallo zum 1.
Hallo zum 2.
Hallo zum 3.
Hallo zum 4.
Hallo zum 5.
Hallo zum 6.
Hallo zum 7.
Hallo zum 8.
Hallo zum 9.
Hallo zum 10.
##########################
### file shebang.sh
##########################
#!/bin/bash
echo "#!/bin/bash"
##########################
### file variable.sh
##########################
#!/bin/bash
var1=Hallo
var2="Hallo Welt"
echo "$var1"
echo "$var2"
unset var1
unset var2
hallololo="Hallo Welt"
hallo="Hallo"
echo "${hallo}lolo"
##########################
### file while.sh
##########################
#!/bin/bash
i=0
while [ $i -lt 10 ]
do
echo "Hallo zum $(($i+1))."
i=$(($i+1))
done