Skip to content

Our code isn't properly locating commands. #1

@estherohiomame

Description

@estherohiomame

I tried to implement command execution, but it's saying command not found.

Reproduce the error

change strtok to _strtok:
Please change the use of strtok to _strtok in the execute.c file.

Compile the code:
gcc -Wall -Werror -Wextra -pedantic -std=gnu89 *.c -o hsh

Run the ls command.

Error: Command not found.
Expected output: List of files in the folder

Suspect Area

The execute_command function in execute.c. There seems to be an issue with either the _getenv function call, the _strtok function call or the _strconcat function call. I'm not sure.

Please fix the error.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions