- Name: [Your Full Name]
- Course: [Course Number and Name]
- Assignment: Username Validation
- Date: [Date of Completion]
[Write 2-3 sentences in your own words describing what this script does and its purpose. Explain the problem it solves and how it works at a high level.]
This script validates usernames according to the following rules:
- Must start with a lowercase letter
- Can only contain lowercase letters, digits, and underscores
- Must be between 3 and 12 characters in length (inclusive)
To run the script interactively:
./username.shTo test with the provided input file:
./username.sh < username-input[Explain in 3-5 sentences how your script validates usernames. Include information about:]
- The use of the
whileloop - The
grepcommand with extended regular expressions - The meaning of the
-Eand-vflags - The redirect
> /dev/null 2>&1
The validation uses the following regular expression pattern:
^[a-z][a-z0-9_]{2,11}$
This pattern ensures that:
- The username starts with a lowercase letter
[a-z] - The following characters are lowercase letters, digits, or underscores
[a-z0-9_] - The total length is between 3 and 12 characters
[Describe your testing process and results. Include:]
- Example valid usernames you tested (at least two)
- Example invalid usernames and why they fail (at least two)
- How you used the username-input file to test
[Optional: Describe any challenges you encountered while creating this script and how you solved them. This could include debugging issues, understanding regular expressions, or Git workflow problems.]
[List any resources you used (class slides, ChatGPT, etc.). Please refer to the course syllabus for more details on citations.]
This project is part of coursework for Chapman University and is intended for educational purposes.