Skip to content

Shell Trial 1#1

Merged
dipachatterjee merged 7 commits intomainfrom
assignment
Oct 17, 2025
Merged

Shell Trial 1#1
dipachatterjee merged 7 commits intomainfrom
assignment

Conversation

@dipachatterjee
Copy link
Owner

@dipachatterjee dipachatterjee commented Oct 3, 2025

What changes are you trying to make? (e.g. adding or removing code, refactoring existing code, adding reports)

I added code to organize and move directories/files, resulting in creating new folders, moving data/files, filtering by specificnames/extensions, and cleaning up sensitive files/

What did you learn from the changes you have made?

I learned how to use basic shell commands like mkdir, mv, cp, rm, and find, and how to be specific in giving my arguments.

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

I followed the assignment's instructions and completed the assignment in git bash (with script edits in VS Code).

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

I ran into a bit of a contradiction between the instructions and the autograder.
Step 2 said to move the entire rawdata directory into ./data/raw — which I did with:
mv ./rawdata ./data/raw
Followed by Step 5 (and similarly for Step 6) as:
cp ./data/raw/rawdata/*server*.log ./data/processed/server_logs
But when I did that, Steps 5 and 6 failed because the server/user/event log files end up inside ./data/raw/rawdata, while the autograder seems to look for them directly in ./data/raw.
To make Step 5+6 pass, I instead moved the contents of rawdata into ./data/raw using:
mv ./rawdata/* ./data/raw
Which made step 5 (and similarly for step 6):
cp ./data/raw/ *server*.log ./data/processed/server_logs
This change made Steps 5 and 6 pass, but then Step 2 failed because the directory (./rawdata) itself wasn’t moved into ./data/raw. I tested both versions, and both scripts run correctly with their specific modifications.
Eventually, I decided to move the whole ./rawdata into ./data/raw and then up-move the contents of the rawdata into ./data/raw, resulting in:

mv ./rawdata ./data/raw
mv ./data/raw/rawdata/* ./data/raw/
rmdir ./data/raw/rawdata

And kept Steps 5 and 6 as:
cp ./data/raw/ *server*.log ./data/processed/server_logs
This workaround satisfied all the conditions of the autograder.

How were these changes tested?

I tested the script initially with bash assignment.sh to see if all conditions were met and the script ran properly.
Then I checked if all directories were created and files moved as needed (with ls)
I verified that my removed files were actually gone.
And I finally checked the inventory.txt (using cat)

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

See "Shell Trial2", "Shell Trial3", and "Shell Trial move whole then up"

Checklist

  • I can confirm that my changes are working as intended

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 comment
Part 1 - Q1
Part 1 - Q2 rawdata not moved to data/raw
Part 1 - Q3
Part 1 - Q4
Part 1 - Q5
Part 1 - Q6
Part 1 - Q7
Part 1 - Q8
Part 2 coworker-changes branch not found in commit history

Please address the issues listed above.

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 comment
Part 1 - Q1
Part 1 - Q2
Part 1 - Q3
Part 1 - Q4
Part 1 - Q5 No server log files in data/raw
Part 1 - Q6 No user log files in data/raw; No event log files in data/raw
Part 1 - Q7
Part 1 - Q8
Part 2 coworker-changes branch not found in commit history

Please address the issues listed above.

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 comment
Part 1 - Q1
Part 1 - Q2 rawdata not moved to data/raw
Part 1 - Q3
Part 1 - Q4
Part 1 - Q5
Part 1 - Q6
Part 1 - Q7
Part 1 - Q8
Part 2 coworker-changes branch not found in commit history

Please address the issues listed above.

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 comment
Part 1 - Q1
Part 1 - Q2 rawdata not moved to data/raw
Part 1 - Q3
Part 1 - Q4
Part 1 - Q5
Part 1 - Q6
Part 1 - Q7
Part 1 - Q8
Part 2

Please address the issues listed above.

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!
Question 2: You could have done the same using single command mv ./rawdata ./data/raw. Remember that the mv command can be used to move as well as rename files/directories.

@dipachatterjee dipachatterjee merged commit 613862c into main Oct 17, 2025
2 checks passed
@dipachatterjee dipachatterjee deleted the assignment branch November 21, 2025 03:10
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