When a command has no slash, the shell searches the directories in PATH in order. Adding a custom bin directory lets you run a tool by name. Replacing PATH with only that directory can hide standard utilities, so retain the system entries. Execute permission also matters: a present file isn't automatically runnable.
These tasks provide a script and ask you to make it discoverable, then verify the route it prints. PATH contains directory names separated by colons. export PATH="$HOME/bin:$PATH" adds a directory at the front and retains the existing search order behind it. Running ./route.sh uses an explicit path and bypasses that search. If a named command fails, inspect its location and execute bit before editing the script's contents.