erste Version der Scripts.
This commit is contained in:
6
teil26/help.txt
Normal file
6
teil26/help.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
Dies ist ein Beispiel für
|
||||
einen mehrzeiligen Text,
|
||||
der für einen Hilfetext steht.
|
||||
|
||||
Programm: ${0##*/}"
|
||||
|
||||
13
teil26/version1.sh
Executable file
13
teil26/version1.sh
Executable file
@@ -0,0 +1,13 @@
|
||||
#! /usr/bin/bash
|
||||
|
||||
# Version 1: Ausgabe über echo
|
||||
|
||||
usage() {
|
||||
echo "Dies ist ein Beispiel für"
|
||||
echo "einen mehrzeiligen Text,"
|
||||
echo "der für einen Hilfetext steht."
|
||||
echo "Programm: ${0##*/}"
|
||||
}
|
||||
|
||||
usage
|
||||
exit 0
|
||||
10
teil26/version2.sh
Executable file
10
teil26/version2.sh
Executable file
@@ -0,0 +1,10 @@
|
||||
#! /usr/bin/bash
|
||||
|
||||
# Version 2: Ausgabe einer externen Datei mit cat
|
||||
|
||||
usage() {
|
||||
cat help.txt
|
||||
}
|
||||
|
||||
usage
|
||||
exit 0
|
||||
17
teil26/version3.sh
Executable file
17
teil26/version3.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#! /usr/bin/bash
|
||||
|
||||
# Version 3: Text als here Doc innerhalb des Scripts
|
||||
|
||||
usage() {
|
||||
cat <<- EOF
|
||||
Dies ist ein Beispiel für
|
||||
einen mehrzeiligen Text,
|
||||
der für einen Hilfetext steht.
|
||||
|
||||
Programm: ${0##*/}"
|
||||
EOF
|
||||
|
||||
}
|
||||
|
||||
usage
|
||||
exit 0
|
||||
18
teil26/version4.sh
Executable file
18
teil26/version4.sh
Executable file
@@ -0,0 +1,18 @@
|
||||
#! /usr/bin/bash
|
||||
|
||||
# Version 3: Text als here Doc innerhalb des Scripts,
|
||||
# diesmal mit Redirection in eine Datei.
|
||||
|
||||
usage() {
|
||||
cat <<- EOF > test.txt
|
||||
Dies ist ein Beispiel für
|
||||
einen mehrzeiligen Text,
|
||||
der für einen Hilfetext steht.
|
||||
|
||||
Programm: ${0##*/}"
|
||||
EOF
|
||||
|
||||
}
|
||||
|
||||
usage
|
||||
exit 0
|
||||
Reference in New Issue
Block a user