ruinedm / Minishell

ZA BEST IN ZA WEST
3 stars 0 forks source link

"command not found" when executing empty file #1

Closed wmBolles closed 3 months ago

wmBolles commented 3 months ago
GoatShell 🐐: touch s && chmod +x s
GoatShell 🐐: sh s
GoatShell 🐐: ./s
./s: command not found
GoatShell 🐐: 

When attempting to execute a newly created file with the ./ s in GoatShell, the shell returns an error stating command not found. However, the file has been correctly created and marked as executable.

Note: 's' is an empty file!

ruinedm commented 3 months ago

You are more than welcome to create a pull request!

ruinedm commented 3 months ago

After a thorough review of your request, it's clear that you don't understand the subject's rules, you are trying to execute a bash shell, it is, and i know this is new to you, NOT A BINARY FILE, so we can't execute it with execve, good luch next time!

wmBolles commented 3 months ago

You can check that the file is empty, instead of checking that the file is binary, or use bash to interpret the file.

However, the subject requirements may make your project useless for some important uses of shell.

After you have completed the project evaluations and validate your "42 Project", you should add these features to your projects.

Make sure that too many people don't know about your stupid subject requirements, or at-least add the subject into the repository.

Good luck

ruinedm commented 3 months ago

You are more than welcome to implement whatever you want in your OWN minishell, if you don't like the code, fork the project and implement whatever you want, i wouldn't push it to the vogsphere repo tho, you might get a CHEAT flag.