# Stage #MG5 works as expected locally but remote test fails

**URL:** <https://forum.codecrafters.io/t/stage-mg5-works-as-expected-locally-but-remote-test-fails/4564>\
**Category:** Challenges\
**Tags:** challenge:shell\
**Created:** [January 31, 2025, 6:52pm UTC](https://forum.codecrafters.io/t/stage-mg5-works-as-expected-locally-but-remote-test-fails/4564 "2025-01-31T18:52:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dhruvj27](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/dhruvj27/32/4651_2.png) [@dhruvj27](https://forum.codecrafters.io/u/dhruvj27)\
**Post date:** [January 31, 2025, 6:52pm UTC](https://forum.codecrafters.io/t/stage-mg5-works-as-expected-locally-but-remote-test-fails/4564/1 "2025-01-31T18:52:45Z")

</div>

Stuck on stage #MG5

Program works perfectly on my local terminal.

```auto
codecrafters-shell-c$ PATH="/tmp/baz:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" ./your_program.sh
$ type cat
cat is /usr/bin/cat
$ type ls
ls is /usr/bin/ls
$ exit

```

But when I test remotely, my program apparently does not print anything, and it fails.

```auto
[tester::#MG5] Running tests for Stage #MG5 (The type builtin: executable files)
[tester::#MG5] [setup] export PATH=/tmp/bar:$PATH
[tester::#MG5] [setup] Available executables:
[tester::#MG5] [setup] - my_exe
[tester::#MG5] Running ./your_program.sh
[your-program] $ type cat
[tester::#MG5] Output does not match expected value.
[tester::#MG5] Expected: "cat is /bin/cat"
[tester::#MG5] Received: ""
[tester::#MG5] Assertion failed.
[tester::#MG5] Test failed

```

This is my repo:  
[codecrafters-shell-c](https://github.com/dhruvj27/codecrafters-shell-c)

---

<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 31, 2025, 6:52pm UTC](https://forum.codecrafters.io/t/stage-mg5-works-as-expected-locally-but-remote-test-fails/4564/2 "2025-01-31T18:52:45Z")

</div>

Hi, thanks for your post!

I’m currently out of the office and will return on Feb 3. I’ll get back to you as soon as possible after I’m back.

---

<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:** [September 25, 2025, 6:58am UTC](https://forum.codecrafters.io/t/stage-mg5-works-as-expected-locally-but-remote-test-fails/4564/4 "2025-09-25T06:58:46Z")

</div>

@dhruvj27, sorry for the delayed response!

Let me know if you still need assistance with this.

---

<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:** [October 1, 2025, 7:28am UTC](https://forum.codecrafters.io/t/stage-mg5-works-as-expected-locally-but-remote-test-fails/4564/6 "2025-10-01T07:28:50Z")

</div>

Closing this thread due to inactivity. If you still need assistance, feel free to reopen or start a new discussion!

---

<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:** [October 6, 2025, 7:29am UTC](https://forum.codecrafters.io/t/stage-mg5-works-as-expected-locally-but-remote-test-fails/4564/7 "2025-10-06T07:29:29Z")

</div>

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