Skip to content

Commit

Permalink
Merge pull request #91 from codecrafters-io/CC-1360
Browse files Browse the repository at this point in the history
CC-1360: update echo commands in your_program.sh to use -n flag
  • Loading branch information
ryan-gang authored Aug 8, 2024
2 parents f655f81 + b46e31e commit 79fc1f5
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions course-definition.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ stages:
Your program will be executed like this:
```bash
$ echo "apple" | ./your_program.sh -E "a"
$ echo -n "apple" | ./your_program.sh -E "a"
```
The `-E` flag instructs `grep` to interprets patterns as extended regular expressions (with support
Expand Down Expand Up @@ -102,7 +102,7 @@ stages:
Your program will be executed like this:
```bash
$ echo "apple123" | ./your_program.sh -E "\d"
$ echo -n "apple123" | ./your_program.sh -E "\d"
```
You program must exit with 0 if a digit is found in the string, and 1 if not.
Expand Down Expand Up @@ -134,7 +134,7 @@ stages:
Your program will be executed like this:
```bash
$ echo "alpha-num3ric" | ./your_program.sh -E "\w"
$ echo -n "alpha-num3ric" | ./your_program.sh -E "\w"
```
You program must exit with 0 if an alphanumeric character is found in the string, and 1 if not.
Expand Down Expand Up @@ -165,7 +165,7 @@ stages:
Your program will be executed like this:
```bash
$ echo "apple" | ./your_program.sh -E "[abc]"
$ echo -n "apple" | ./your_program.sh -E "[abc]"
```
You program must exit with 0 if an any of the characters are found in the string, and 1 if not.
Expand Down Expand Up @@ -195,7 +195,7 @@ stages:
Your program will be executed like this:
```bash
$ echo "apple" | ./your_program.sh -E "[^abc]"
$ echo -n "apple" | ./your_program.sh -E "[^abc]"
```
You program must exit with 0 if the input contains characters that aren't part of the negative character group, and 1 if not.
Expand Down Expand Up @@ -235,7 +235,7 @@ stages:
Your program will be executed like this:
```bash
$ echo "1 apple" | ./your_program.sh -E "\d apple"
$ echo -n "1 apple" | ./your_program.sh -E "\d apple"
```
You program must exit with 0 if the pattern matches the input, and 1 if not.
Expand Down Expand Up @@ -268,7 +268,7 @@ stages:
Your program will be executed like this:
```bash
$ echo "log" | ./your_program.sh -E "^log"
$ echo -n "log" | ./your_program.sh -E "^log"
```
You program must exit with 0 if the input starts with the given pattern, and 1 if not.
Expand Down Expand Up @@ -298,7 +298,7 @@ stages:
Your program will be executed like this:
```bash
$ echo "dog" | ./your_program.sh -E "dog$"
$ echo -n "dog" | ./your_program.sh -E "dog$"
```
You program must exit with 0 if the input matches the given pattern, and 1 if not.
Expand Down Expand Up @@ -326,7 +326,7 @@ stages:
Your program will be executed like this:
```bash
$ echo "caats" | ./your_program.sh -E "ca+ts"
$ echo -n "caats" | ./your_program.sh -E "ca+ts"
```
You program must exit with 0 if the input matches the given pattern, and 1 if not.
Expand All @@ -352,7 +352,7 @@ stages:
Your program will be executed like this:
```bash
$ echo "dogs" | ./your_program.sh -E "dogs?"
$ echo -n "dogs" | ./your_program.sh -E "dogs?"
```
You program must exit with 0 if the input matches the given pattern, and 1 if not.
Expand All @@ -378,7 +378,7 @@ stages:
Your program will be executed like this:
```bash
$ echo "dog" | ./your_program.sh -E "d.g"
$ echo -n "dog" | ./your_program.sh -E "d.g"
```
You program must exit with 0 if the input matches the given pattern, and 1 if not.
Expand All @@ -404,7 +404,7 @@ stages:
Your program will be executed like this:
```bash
$ echo "cat" | ./your_program.sh -E "(cat|dog)"
$ echo -n "cat" | ./your_program.sh -E "(cat|dog)"
```
You program must exit with 0 if the input matches the given pattern, and 1 if not.
Expand Down Expand Up @@ -439,7 +439,7 @@ stages:
Your program will be executed like this:
```
$ echo "<input>" | ./your_program.sh -E "<pattern>"
$ echo -n "<input>" | ./your_program.sh -E "<pattern>"
```
Your program must exit with 0 if the input matches the given pattern, and 1 if not.
Expand All @@ -464,7 +464,7 @@ stages:
Your program will be executed like this:
```
$ echo "<input>" | ./your_program.sh -E "<pattern>"
$ echo -n "<input>" | ./your_program.sh -E "<pattern>"
```
Your program must exit with 0 if the input matches the given pattern, and 1 if not.
Expand All @@ -485,7 +485,7 @@ stages:
Your program will be executed like this:
```
$ echo "<input>" | ./your_program.sh -E "<pattern>"
$ echo -n "<input>" | ./your_program.sh -E "<pattern>"
```
Your program must exit with 0 if the input matches the given pattern, and 1 if not.
Expand Down

0 comments on commit 79fc1f5

Please sign in to comment.