Skip to content

Updated assignment.sh script#1

Open
AlexanderTheAlright wants to merge 5 commits intomainfrom
assignment
Open

Updated assignment.sh script#1
AlexanderTheAlright wants to merge 5 commits intomainfrom
assignment

Conversation

@AlexanderTheAlright
Copy link
Owner

What changes are you trying to make?

I completed and refined the assignment.sh script to automate project setup and data organization. The script now:

  • Creates standard directories (analysis, output, data, and subfolders for processed logs).
  • Moves raw data into structured folders.
  • Removes sensitive files containing IP addresses.
  • Generates an inventory file listing all processed files.

What did you learn from the changes you have made?

I learned how to use core Bash commands (mkdir, mv, cp, rm, and find) to automate directory creation and file management. I also practiced ensuring portability by using relative paths and verifying that scripts run correctly in any environment.

Was there another approach you were thinking about making? If so, what approach(es) were you thinking of?

I considered using loops or conditionals to handle each log type more dynamically but decided to keep the logic simple and explicit since the instructions specified fixed categories.

Were there any challenges? If so, what issue(s) did you face? How did you overcome it?

The main challenge was ensuring the correct handling of wildcard patterns when copying log files into subfolders. Initially, some patterns overlapped or missed matches. I resolved this by testing each pattern independently and verifying output using ls.
Another challenge was managing Git commits and branches correctly in Bash; I practiced using branch isolation and learned to avoid committing generated directories.

How were these changes tested?

I ran the script multiple times locally using bash assignment.sh, confirming that:

  • All required directories were created in the correct structure.
  • Files were moved or copied as expected.
  • Sensitive files were removed.
  • The inventory.txt file listed all processed files accurately.
    I also cleaned up (rm -rf newproject/) between runs to ensure consistent results.

A reference to a related issue in your repository (if applicable)

N/A

Checklist

  • I can confirm that my changes are working as intended
  • I verified that the script runs successfully with no hardcoded paths
  • I confirmed that all GitHub submission requirements were followed

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Autograder results

question status
Part 1 - Q1
Part 1 - Q2
Part 1 - Q3
Part 1 - Q4
Part 1 - Q5
Part 1 - Q6
Part 1 - Q7
Part 1 - Q8
Part 2

Copy link

@anjali-deshpande-hub anjali-deshpande-hub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done! I loved your PR comments. It can be used to showcase how PR should be commented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants