Skip to content

Commit 80ccbb9

Browse files
Fix Variables tutorial for learnshell.org
1 parent bd006eb commit 80ccbb9

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

tutorials/learnshell.org/de/Variables.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Beachte, dass wenn das Skript läuft, wird der Befehl innerhalb der `$()` Klamme
3131

3232
Übung
3333
-----
34-
Das Ziel dieser Übung ist einen String, eine Ganzzahl und eine komplexe Variable durch Befehlsubstitution zu erstellen. Der String sollte `BIRTHDATE` heißen und sollte "Jan 1 2000" enthalten. Die Ganzzahl sollte `Presents` genannt werden und sollte die Zahl 10 enthalten. Die komplexe Variable sollte `BIRTHDAY` heißen und den vollen Wochentag des Tages, in `BIRHTDATE`, zum Beispiel 'Samstag' (vielleicht in einer anderen Sprache). Beachte, dass der `date` Befehl dafür benutzt werden kann, Daten in andere Datenformate zu konvertieren. Zum Beispiel, um das Datum in `$date1` zu dessen Wochentag zu konvertieren:
34+
Das Ziel dieser Übung ist einen String, eine Ganzzahl und eine komplexe Variable durch Befehlsubstitution zu erstellen. Der String sollte `BIRTHDATE` heißen und sollte "Jan 1, 2000" enthalten. Die Ganzzahl sollte `Presents` genannt werden und sollte die Zahl 10 enthalten. Die komplexe Variable sollte `BIRTHDAY` heißen und den vollen Wochentag des Tages, in `BIRHTDATE`, zum Beispiel 'Samstag' (vielleicht in einer anderen Sprache). Beachte, dass der `date` Befehl dafür benutzt werden kann, Daten in andere Datenformate zu konvertieren. Zum Beispiel, um das Datum in `$date1` zu dessen Wochentag zu konvertieren:
3535

3636
date -d "$date1" +%A
3737

@@ -45,7 +45,7 @@ Tutorial Code
4545

4646
# Testcode
4747

48-
if [ "$BIRTHDATE" == "Jan 1 2000" ] ; then
48+
if [ "$BIRTHDATE" == "Jan 1, 2000" ] ; then
4949
echo "BIRTHDATE ist korrekt, es ist $BIRTHDATE"
5050
else
5151
echo "BIRTHDATE ist nicht korrekt"
@@ -71,13 +71,13 @@ Lösung
7171
------
7272
#!/bin/bash
7373
# Bearbeite diesen Code
74-
BIRTHDATE="Jan 1 2000"
74+
BIRTHDATE="Jan 1, 2000"
7575
Presents=10
7676
BIRTHDAY=`date -d "$BIRTHDATE" +%A`
7777

7878
# Testcode
7979

80-
if [ "$BIRTHDATE" == "Jan 1 2000" ] ; then
80+
if [ "$BIRTHDATE" == "Jan 1, 2000" ] ; then
8181
echo "BIRTHDATE ist korrekt, es ist $BIRTHDATE"
8282
else
8383
echo "BIRTHDATE ist nicht korrekt"

tutorials/learnshell.org/en/Variables.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Note that when the script runs, it will run the command inside the $() parenthes
3333

3434
Exercise
3535
--------
36-
The target of this exercise is to create a string, an integer, and a complex variable using command substitution. The string should be named BIRTHDATE and should contain the text "Jan 1 2000". The integer should be named Presents and should contain the number 10. The complex variable should be named BIRTHDAY and should contain the full weekday name of the day matching the date in variable BIRTHDATE e.g. Saturday. Note that the 'date' command can be used to convert a date format into a different date format. For example, to convert date value, $date1, to day of the week of date1, use:
36+
The target of this exercise is to create a string, an integer, and a complex variable using command substitution. The string should be named BIRTHDATE and should contain the text "Jan 1, 2000". The integer should be named Presents and should contain the number 10. The complex variable should be named BIRTHDAY and should contain the full weekday name of the day matching the date in variable BIRTHDATE e.g. Saturday. Note that the 'date' command can be used to convert a date format into a different date format. For example, to convert date value, $date1, to day of the week of date1, use:
3737

3838
date -d "$date1" +%A
3939

@@ -48,7 +48,7 @@ Tutorial Code
4848

4949
# Testing code - do not change it
5050

51-
if [ "$BIRTHDATE" == "Jan 1 2000" ] ; then
51+
if [ "$BIRTHDATE" == "Jan 1, 2000" ] ; then
5252
echo "BIRTHDATE is correct, it is $BIRTHDATE"
5353
else
5454
echo "BIRTHDATE is incorrect - please retry"
@@ -74,14 +74,14 @@ Solution
7474
--------
7575
#!/bin/bash
7676
# Change this code
77-
BIRTHDATE="Jan 1 2000"
77+
BIRTHDATE="Jan 1, 2000"
7878
Presents=10
7979
BIRTHDAY=`date -d "$BIRTHDATE" +%A`
8080

8181

8282
# Testing code - do not change it
8383

84-
if [ "$BIRTHDATE" == "Jan 1 2000" ] ; then
84+
if [ "$BIRTHDATE" == "Jan 1, 2000" ] ; then
8585
echo "BIRTHDATE is correct, it is $BIRTHDATE"
8686
else
8787
echo "BIRTHDATE is incorrect - please retry"

0 commit comments

Comments
 (0)