A system administrator is troubleshooting a user's report that a command 'myapp' is not found. The administrator checks the PATH variable and sees it includes /usr/local/bin. The administrator verifies that the binary 'myapp' exists in /usr/local/bin with permissions 755. However, running 'myapp' still fails with 'command not found'. What is the most likely cause?
Trap 1: The user's PATH does not include /usr/local/bin
The administrator checked the PATH and it includes the directory, but this is the administrator's PATH, not the user's. However, the question implies the administrator is testing as the user or the user's environment is similar.
Trap 2: The binary is a shell script missing a shebang
If it's a binary, no shebang needed. If it's a script, missing shebang would cause different error.
Trap 3: The binary does not have execute permission for the user
Permissions are 755, so execute is allowed.
- A
The user's PATH does not include /usr/local/bin
Why wrong: The administrator checked the PATH and it includes the directory, but this is the administrator's PATH, not the user's. However, the question implies the administrator is testing as the user or the user's environment is similar.
- B
The binary is a shell script missing a shebang
Why wrong: If it's a binary, no shebang needed. If it's a script, missing shebang would cause different error.
- C
The shell's hash table is stale; run 'hash -r'
Correct: the shell caches command locations, and may not have updated after the binary was added.
- D
The binary does not have execute permission for the user
Why wrong: Permissions are 755, so execute is allowed.