# Shell challenge,clarification in test case of #UN3 Append STDERR, tester is not expecting content in file mentioned as target for stderr appending for a command which gives error

**URL:** <https://forum.codecrafters.io/t/shell-challenge-clarification-in-test-case-of-un3-append-stderr-tester-is-not-expecting-content-in-file-mentioned-as-target-for-stderr-appending-for-a-command-which-gives-error/12064>\
**Category:** Challenges\
**Tags:** challenge:shell\
**Created:** [June 13, 2025, 7:49am UTC](https://forum.codecrafters.io/t/shell-challenge-clarification-in-test-case-of-un3-append-stderr-tester-is-not-expecting-content-in-file-mentioned-as-target-for-stderr-appending-for-a-command-which-gives-error/12064 "2025-06-13T07:49:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![RishabhSahuIIIT](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/rishabhsahuiiit/32/11744_2.png) [@RishabhSahuIIIT](https://forum.codecrafters.io/u/RishabhSahuIIIT)\
**Post date:** [June 13, 2025, 7:49am UTC](https://forum.codecrafters.io/t/shell-challenge-clarification-in-test-case-of-un3-append-stderr-tester-is-not-expecting-content-in-file-mentioned-as-target-for-stderr-appending-for-a-command-which-gives-error/12064/1 "2025-06-13T07:49:59Z")

</div>

I was executing tests today while working on Dual command pipeline implementation. For the test case and response,

```auto
[your-program] $ ls -1 nonexistent 2>> /tmp/qux/baz.md
[your-program] $ cat /tmp/qux/baz.md
[tester::#UN3] Expected /tmp/qux/bar.md to contain "" but received "ls: nonexistent: No such file or directory\n" 

```

I am confused as to why is the file expected to be empty? Even though the command specifically mentions the file to be used as stderr append destination, and the command will give the so mentioned error because nonexistent file does not exist. Is this test case actually correct? If so please mention and explain how the response of this test is valid, and if required I will post my code for finding out mistakes.

---

<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:** [June 13, 2025, 8:20am UTC](https://forum.codecrafters.io/t/shell-challenge-clarification-in-test-case-of-un3-append-stderr-tester-is-not-expecting-content-in-file-mentioned-as-target-for-stderr-appending-for-a-command-which-gives-error/12064/4 "2025-06-13T08:20:55Z")

</div>

Hey @RishabhSahuIIIT, the tester expects the **previous file** to stay empty:

 ![image](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/2X/3/354f61cc253f6cfd936edb2a302e5f2d4828b3ba.png)

Let me know if you’d like further clarification!

---

<div class="post-metadata">

**Author:** ![RishabhSahuIIIT](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/rishabhsahuiiit/32/11744_2.png) [@RishabhSahuIIIT](https://forum.codecrafters.io/u/RishabhSahuIIIT)\
**Post date:** [June 13, 2025, 11:51am UTC](https://forum.codecrafters.io/t/shell-challenge-clarification-in-test-case-of-un3-append-stderr-tester-is-not-expecting-content-in-file-mentioned-as-target-for-stderr-appending-for-a-command-which-gives-error/12064/6 "2025-06-13T11:51:40Z")

</div>

Thanks for the clarification , I was able to resolve it now.

---

<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:** [June 22, 2025, 5:19am UTC](https://forum.codecrafters.io/t/shell-challenge-clarification-in-test-case-of-un3-append-stderr-tester-is-not-expecting-content-in-file-mentioned-as-target-for-stderr-appending-for-a-command-which-gives-error/12064/7 "2025-06-22T05:19:06Z")

</div>

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