Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions stage_descriptions/base-07-mg5.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ For example, if PATH is `/dir1:/dir2:/dir3`, your shell should search in `/dir1`
- If a matching files is found and it has execute permissions, your shell should print the path to the file.
- If no matching files are found, your shell should print `<command>: not found`.

{{#lang_is_elixir}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Let's move this to the notes section
  2. Let's add a fallback case for a generic language
  3. We don't have to say it's not recommended - a shell would usually use this, so it's okay.

For Elixir, you could say something like:

You can either use System.find_executable or implement the PATH traversal logic on your own.

For others, could be something like:

Most programming languages have methods in their standard library that can help with PATH traversal. For example, xyz in Python and in Go.

It's not recommended to use [System.find_executable](https://hexdocs.pm/elixir/1.18.4/System.html#find_executable/1) if you'd like to learn how to implement the functionality manully.
{{/lang_is_elixir}}

### Tests

The tester will execute your program with a custom `PATH` like this:
Expand Down
Loading