Skip to content

chapman-intro-to-nix/username

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

README for Username Validation Script

Author Information

  • Name: [Your Full Name]
  • Course: [Course Number and Name]
  • Assignment: Username Validation
  • Date: [Date of Completion]

Program Description

[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.]

Username Requirements

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)

Usage

To run the script interactively:

./username.sh

To test with the provided input file:

./username.sh < username-input

How the Script Works

[Explain in 3-5 sentences how your script validates usernames. Include information about:]

  • The use of the while loop
  • The grep command with extended regular expressions
  • The meaning of the -E and -v flags
  • The redirect > /dev/null 2>&1

Regular Expression Pattern

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

Testing Results

[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

Challenges and Solutions

[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.]

Resources

[List any resources you used (class slides, ChatGPT, etc.). Please refer to the course syllabus for more details on citations.]

License

This project is part of coursework for Chapman University and is intended for educational purposes.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors