Step 3 - Challenge: Handling Non-Existent Commands
Step 3 - Challenge: Handling Non-Existent Commands
Build Your Own Shell (Python Edition)
Step 1 - Create The Simplest Possible Command Line Shell
Step 1 - Create The Simplest Possible Command Line Shell
Step 2 - Challenge: Handle Multiple Commands
Step 2 - Challenge: Handle Multiple Commands
Step 3 - Non Existent Commands
Step 3 - Non Existent Commands
Step 4 - External Commands With Arguments
Step 4 - External Commands With Arguments
Step 7 - Handling Signals
Step 7 - Handling Signals
Conclusion
Conclusion
In this step your goal is to handle non-existent commands.
Now that we can enter multiple commands and safely exit our shell, we want to ensure it is robust. That is, if the user tries to run a command that doesn’t exist our shell shouldn’t crash.
That should look something like this when it’s done:
% ccsh
ccsh> fubar
FileNotFoundError: [Errno 2] No such file or directory: 'fubar'
ccsh> exit
%