Skip to content

Commit 79fc1f5

Browse files
authored
Merge pull request #91 from codecrafters-io/CC-1360
CC-1360: update echo commands in your_program.sh to use -n flag
2 parents f655f81 + b46e31e commit 79fc1f5

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

course-definition.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ stages:
7070
Your program will be executed like this:
7171
7272
```bash
73-
$ echo "apple" | ./your_program.sh -E "a"
73+
$ echo -n "apple" | ./your_program.sh -E "a"
7474
```
7575
7676
The `-E` flag instructs `grep` to interprets patterns as extended regular expressions (with support
@@ -102,7 +102,7 @@ stages:
102102
Your program will be executed like this:
103103
104104
```bash
105-
$ echo "apple123" | ./your_program.sh -E "\d"
105+
$ echo -n "apple123" | ./your_program.sh -E "\d"
106106
```
107107
108108
You program must exit with 0 if a digit is found in the string, and 1 if not.
@@ -134,7 +134,7 @@ stages:
134134
Your program will be executed like this:
135135
136136
```bash
137-
$ echo "alpha-num3ric" | ./your_program.sh -E "\w"
137+
$ echo -n "alpha-num3ric" | ./your_program.sh -E "\w"
138138
```
139139
140140
You program must exit with 0 if an alphanumeric character is found in the string, and 1 if not.
@@ -165,7 +165,7 @@ stages:
165165
Your program will be executed like this:
166166
167167
```bash
168-
$ echo "apple" | ./your_program.sh -E "[abc]"
168+
$ echo -n "apple" | ./your_program.sh -E "[abc]"
169169
```
170170
171171
You program must exit with 0 if an any of the characters are found in the string, and 1 if not.
@@ -195,7 +195,7 @@ stages:
195195
Your program will be executed like this:
196196
197197
```bash
198-
$ echo "apple" | ./your_program.sh -E "[^abc]"
198+
$ echo -n "apple" | ./your_program.sh -E "[^abc]"
199199
```
200200
201201
You program must exit with 0 if the input contains characters that aren't part of the negative character group, and 1 if not.
@@ -235,7 +235,7 @@ stages:
235235
Your program will be executed like this:
236236
237237
```bash
238-
$ echo "1 apple" | ./your_program.sh -E "\d apple"
238+
$ echo -n "1 apple" | ./your_program.sh -E "\d apple"
239239
```
240240
241241
You program must exit with 0 if the pattern matches the input, and 1 if not.
@@ -268,7 +268,7 @@ stages:
268268
Your program will be executed like this:
269269
270270
```bash
271-
$ echo "log" | ./your_program.sh -E "^log"
271+
$ echo -n "log" | ./your_program.sh -E "^log"
272272
```
273273
274274
You program must exit with 0 if the input starts with the given pattern, and 1 if not.
@@ -298,7 +298,7 @@ stages:
298298
Your program will be executed like this:
299299
300300
```bash
301-
$ echo "dog" | ./your_program.sh -E "dog$"
301+
$ echo -n "dog" | ./your_program.sh -E "dog$"
302302
```
303303
304304
You program must exit with 0 if the input matches the given pattern, and 1 if not.
@@ -326,7 +326,7 @@ stages:
326326
Your program will be executed like this:
327327
328328
```bash
329-
$ echo "caats" | ./your_program.sh -E "ca+ts"
329+
$ echo -n "caats" | ./your_program.sh -E "ca+ts"
330330
```
331331
332332
You program must exit with 0 if the input matches the given pattern, and 1 if not.
@@ -352,7 +352,7 @@ stages:
352352
Your program will be executed like this:
353353
354354
```bash
355-
$ echo "dogs" | ./your_program.sh -E "dogs?"
355+
$ echo -n "dogs" | ./your_program.sh -E "dogs?"
356356
```
357357
358358
You program must exit with 0 if the input matches the given pattern, and 1 if not.
@@ -378,7 +378,7 @@ stages:
378378
Your program will be executed like this:
379379
380380
```bash
381-
$ echo "dog" | ./your_program.sh -E "d.g"
381+
$ echo -n "dog" | ./your_program.sh -E "d.g"
382382
```
383383
384384
You program must exit with 0 if the input matches the given pattern, and 1 if not.
@@ -404,7 +404,7 @@ stages:
404404
Your program will be executed like this:
405405
406406
```bash
407-
$ echo "cat" | ./your_program.sh -E "(cat|dog)"
407+
$ echo -n "cat" | ./your_program.sh -E "(cat|dog)"
408408
```
409409
410410
You program must exit with 0 if the input matches the given pattern, and 1 if not.
@@ -439,7 +439,7 @@ stages:
439439
Your program will be executed like this:
440440
441441
```
442-
$ echo "<input>" | ./your_program.sh -E "<pattern>"
442+
$ echo -n "<input>" | ./your_program.sh -E "<pattern>"
443443
```
444444
445445
Your program must exit with 0 if the input matches the given pattern, and 1 if not.
@@ -464,7 +464,7 @@ stages:
464464
Your program will be executed like this:
465465
466466
```
467-
$ echo "<input>" | ./your_program.sh -E "<pattern>"
467+
$ echo -n "<input>" | ./your_program.sh -E "<pattern>"
468468
```
469469
470470
Your program must exit with 0 if the input matches the given pattern, and 1 if not.
@@ -485,7 +485,7 @@ stages:
485485
Your program will be executed like this:
486486
487487
```
488-
$ echo "<input>" | ./your_program.sh -E "<pattern>"
488+
$ echo -n "<input>" | ./your_program.sh -E "<pattern>"
489489
```
490490
491491
Your program must exit with 0 if the input matches the given pattern, and 1 if not.

0 commit comments

Comments
 (0)