-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
Description
The comments feature of the shell is similar to what you already know about comments in programming.
They are a way of giving hints to the user and ourselves and are not necessarily processed by the computer as a special case.
Your task is to get rid of all possible comments in user input at the prompt. This will be done at the initial stages of parsing the user's input. Your function will
- take the user's input
- parser it while looking for comments (starts with the
#sign) - once it finds one, it gets rid of everything after that
- finally, it returns the updated string for further processing or parsing
Note: if you don't find any # in the input string, return the original string as is. Also, as an edge case, check these out
ls #/tmp
ls#/tmpWhat was the output when executed on sh?
Do you understand why?
Reactions are currently unavailable
Metadata
Metadata
Labels
Type
Projects
Status
📋 Backlog