diff --git a/20231018.p0/dbs-20231018.txt b/20231018.p0/dbs-20231018.txt new file mode 100644 index 0000000000000000000000000000000000000000..51df12517b4922d5849498d6aa0973300b9d2a96 --- /dev/null +++ b/20231018.p0/dbs-20231018.txt @@ -0,0 +1,21 @@ +Aufgabe: Schreiben Sie ein Shell-Skript, das aus einer selbst erstellten +Textdatei (z.B. CSV) Daten extrahiert. Welche Daten, soll per Parameter +angegeben werden. + +Beispiel: Tabelle + + ID Name Tierart + ---------------------- + 01 Wuffi Kater + 02 Maunzi Dt. Schäferhund + 03 Mausi Afr. Elefant + 04 Gargantua Spitzmaus + + $ ./programmchen 01 Tierart + Kater + $ ./programmchen 03 Name + Mausi + +Hinweise: + - man grep + - man cut diff --git a/20231018.p0/hello-01.sh b/20231018.p0/hello-01.sh new file mode 100755 index 0000000000000000000000000000000000000000..9f3f770bfcccad3d62d2e2d08b077469ef3722fa --- /dev/null +++ b/20231018.p0/hello-01.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +echo "Hello, world!" diff --git a/20231018.p0/hello-01.txt b/20231018.p0/hello-01.txt new file mode 100644 index 0000000000000000000000000000000000000000..5cb2b1daba9a8a8fc5bb4096662d533c42725231 --- /dev/null +++ b/20231018.p0/hello-01.txt @@ -0,0 +1,14 @@ +cassini/home/peter/bo/2023ws/dbs/20231018.p0> ls -l +insgesamt 4 +-rw-r--r-- 1 peter peter 34 18. Okt 13:14 hello-01.sh +cassini/home/peter/bo/2023ws/dbs/20231018.p0> cat hello-01.sh +#!/bin/bash + +echo "Hello, world!" +cassini/home/peter/bo/2023ws/dbs/20231018.p0> chmod +x hello-01.sh +cassini/home/peter/bo/2023ws/dbs/20231018.p0> ls -l +insgesamt 4 +-rwxr-xr-x 1 peter peter 34 18. Okt 13:14 hello-01.sh +cassini/home/peter/bo/2023ws/dbs/20231018.p0> ./hello-01.sh +Hello, world! +cassini/home/peter/bo/2023ws/dbs/20231018.p0> diff --git a/20231018.p0/hello-02.sh b/20231018.p0/hello-02.sh new file mode 100755 index 0000000000000000000000000000000000000000..2fcc8026436fe9bc8c1321e872ed2d4cc16f6d02 --- /dev/null +++ b/20231018.p0/hello-02.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +echo "Hello, $1!" diff --git a/20231018.p0/hello-02.txt b/20231018.p0/hello-02.txt new file mode 100644 index 0000000000000000000000000000000000000000..f6433dc1b4bcd99ce95c1e678965d7e1feedf68a --- /dev/null +++ b/20231018.p0/hello-02.txt @@ -0,0 +1,13 @@ +cassini/home/peter/bo/2023ws/dbs/20231018.p0> cat hello-02.sh +#!/bin/bash + +echo "Hello, $1!" +cassini/home/peter/bo/2023ws/dbs/20231018.p0> ./hello-02.sh +Hello, ! +cassini/home/peter/bo/2023ws/dbs/20231018.p0> ./hello-02.sh Peter +Hello, Peter! +cassini/home/peter/bo/2023ws/dbs/20231018.p0> ./hello-02.sh Peter Gerwinski +Hello, Peter! +cassini/home/peter/bo/2023ws/dbs/20231018.p0> ./hello-02.sh "Peter Gerwinski" +Hello, Peter Gerwinski! +cassini/home/peter/bo/2023ws/dbs/20231018.p0> diff --git a/20231018.p0/hello-03.sh b/20231018.p0/hello-03.sh new file mode 100755 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/20231018.p0/hello-03.txt b/20231018.p0/hello-03.txt new file mode 100644 index 0000000000000000000000000000000000000000..3b180b5a9ebc65af567ff58f9d417f624fdb7e97 --- /dev/null +++ b/20231018.p0/hello-03.txt @@ -0,0 +1,7 @@ +cassini/home/peter/bo/2023ws/dbs/20231018.p0> cat hello-03.sh +#!/bin/bash + +echo "Hello, $0!" +cassini/home/peter/bo/2023ws/dbs/20231018.p0> ./hello-03.sh "Schön hier." +Hello, ./hello-03.sh! +cassini/home/peter/bo/2023ws/dbs/20231018.p0> diff --git a/20231018.p0/hello-04.sh b/20231018.p0/hello-04.sh new file mode 100755 index 0000000000000000000000000000000000000000..62673d7a65595c1135ebebf41f9a7c355c1cf192 --- /dev/null +++ b/20231018.p0/hello-04.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +if [ "$1" = "en" ]; then + echo "Hello, world!" +elif [ "$1" = "de" ]; then + echo "Hallo, Welt!" +else + echo "Usage: $0 <language>" +fi diff --git a/20231018.p0/hello-04.txt b/20231018.p0/hello-04.txt new file mode 100644 index 0000000000000000000000000000000000000000..b71b3846e0aefb8a3fbfeae1bbfc37e9b08bd1b1 --- /dev/null +++ b/20231018.p0/hello-04.txt @@ -0,0 +1,18 @@ +"hello-04.sh" 9L, 148B geschrieben + +#!/bin/bash + +if [ "$1" = "en" ]; then + echo "Hello, world!" +elif [ "$1" = "de" ]; then + echo "Hallo, Welt!" +else + echo "Usage: $0 <language>" +fi +cassini/home/peter/bo/2023ws/dbs/20231018.p0> ./hello-04.sh +Usage: ./hello-04.sh <language> +cassini/home/peter/bo/2023ws/dbs/20231018.p0> ./hello-04.sh de +Hallo, Welt! +cassini/home/peter/bo/2023ws/dbs/20231018.p0> ./hello-04.sh en +Hello, world! +cassini/home/peter/bo/2023ws/dbs/20231018.p0>