# Maybe wrong prompt in QJ0

**URL:** <https://forum.codecrafters.io/t/maybe-wrong-prompt-in-qj0/15843>\
**Category:** Challenges\
**Tags:** challenge:shell\
**Created:** [January 28, 2026, 8:43am UTC](https://forum.codecrafters.io/t/maybe-wrong-prompt-in-qj0/15843 "2026-01-28T08:43:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![oliver-brm](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/oliver-brm/32/6727_2.png) [@oliver-brm](https://forum.codecrafters.io/u/oliver-brm)\
**Post date:** [January 28, 2026, 8:43am UTC](https://forum.codecrafters.io/t/maybe-wrong-prompt-in-qj0/15843/1 "2026-01-28T08:43:36Z")

</div>

I’m not really stuck on Stage #QJ0 but wanted to report what I think is a wrong test case.

It’s particularly about the executable `exe with \‘single quotes\’`. The test case tries to call that executable via the command

```bash
[your-program] $ "exe with \'single quotes\'" /tmp/ant/f3

```

Please note the _single_ backslashes (`\`) before the single quotes. If a quoted executable name must be interpreted like a quoted argument, as the text in #QJ0 states, those single backslashes would _escape_ the single quotes.

I’ve listed the directory on the test runner which contains the executables. The particular executable’s file name also contains backslashes:

```bash
[your-program] "Listing /tmp/pig"
[your-program] cat
[your-program] exe with space
[your-program] exe with "quotes"
[your-program] exe with \'single quotes\'
[your-program] exe with \n newline
[your-program] f1
[your-program] f2
[your-program] f3
[your-program] f4
[your-program] strawberry blueberry.
[your-program] $

```

So, the correct command line to issue in the test must be

```bash
[your-program] $ "exe with \\'single quotes\\'" /tmp/ant/f3

```

Please note the escaped backslashes.

I’m not really stuck because I can work around this issue.

---

<div class="post-metadata">

**Author:** ![senevoldsen](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/senevoldsen/32/6460_2.png) [@senevoldsen](https://forum.codecrafters.io/u/senevoldsen)\
**Post date:** [January 28, 2026, 9:03am UTC](https://forum.codecrafters.io/t/maybe-wrong-prompt-in-qj0/15843/3 "2026-01-28T09:03:54Z")

</div>

To be clear with the input given: `"exe with \'single quotes\'"` parsing it should give `exe with \'single quotes\'`.

I think you might misunderstand the escaping rules. Inside `" here "` the character `\` only escapes _some_ symbols, and `'` is not one of them. So `"\'"` is `\'` and not `'`, the backslash is a literal part of the result.

---

<div class="post-metadata">

**Author:** ![senevoldsen](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/senevoldsen/32/6460_2.png) [@senevoldsen](https://forum.codecrafters.io/u/senevoldsen)\
**Post date:** [January 28, 2026, 9:08am UTC](https://forum.codecrafters.io/t/maybe-wrong-prompt-in-qj0/15843/4 "2026-01-28T09:08:23Z")

</div>

To expand, the previous stage `gu3` covers this and says:

> Within [double quotes](https://www.gnu.org/software/bash/manual/bash.html#Double-Quotes), a backslash only escapes certain special characters: `"`, `\`, `$`, `, and `newline`

If you look at Bash manual it says the same thing

> Enclosing characters in double quotes (`"`) preserves the literal value of all characters within the quotes, with the exception of `$`, `, `\`, … The characters `$` and ` retain their special meaning within double quotes (see Shell Expansions). The backslash retains its special meaning only when followed by one of the following characters: `$`, `, `"`, `\`, or newline. Within double quotes, backslashes that are followed by one of these characters are removed. Backslashes preceding characters without a special meaning are left unmodified.

> **[Double Quotes (Bash Reference Manual)](https://www.gnu.org/software/bash/manual/html_node/Double-Quotes.html)**
>
> Double Quotes (Bash Reference Manual)

But yeah it is counterintuitive, because in most languages and context `\` is an universal escaper that works for any following character.

---

<div class="post-metadata">

**Author:** ![andy1li](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/andy1li/32/10_2.png) [@andy1li](https://forum.codecrafters.io/u/andy1li)\
**Post date:** [January 28, 2026, 9:09am UTC](https://forum.codecrafters.io/t/maybe-wrong-prompt-in-qj0/15843/5 "2026-01-28T09:09:01Z")

</div>

Hey @oliver-brm, as @senevoldsen mentioned, the backslash is treated as a literal character here, so `\'` should be parsed as a backslash followed by a single quote, not as an escaped quote.

That said, you’re absolutely right that the current test case is confusing and easy to misinterpret. We’re updating it to make the expected behavior clearer in [this PR](https://github.com/codecrafters-io/shell-tester/pull/179).

Thanks a lot for highlighting this!

---

<div class="post-metadata">

**Author:** ![oliver-brm](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/oliver-brm/32/6727_2.png) [@oliver-brm](https://forum.codecrafters.io/u/oliver-brm)\
**Post date:** [January 28, 2026, 9:14am UTC](https://forum.codecrafters.io/t/maybe-wrong-prompt-in-qj0/15843/6 "2026-01-28T09:14:06Z")

</div>

Thanks for clearing!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/3X/7/0/700657133935c15703e22c7c8870394f6e6dc27d.svg) [@system](https://forum.codecrafters.io/u/system)\
**Post date:** [February 2, 2026, 9:14am UTC](https://forum.codecrafters.io/t/maybe-wrong-prompt-in-qj0/15843/7 "2026-02-02T09:14:30Z")

</div>

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.
