Skip to content

Homework1 - Shell commands - submission#3

Open
sari-tech wants to merge 1 commit intomainfrom
Assignment
Open

Homework1 - Shell commands - submission#3
sari-tech wants to merge 1 commit intomainfrom
Assignment

Conversation

@sari-tech
Copy link
Owner

@sari-tech sari-tech commented Apr 26, 2024

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

What did you learn from the changes you have made?

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

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

How were these changes tested?

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

@mentions of the person or team responsible for reviewing proposed changes (At least 2 people)

@michaeladrouillard
@dtxe

Checklist

  • I can confirm that my changes are working as intended
  • uoft-dsi-c3-homework-20240425
  • uoft-dsi-c3-homework-20240426

@sari-tech sari-tech closed this Apr 26, 2024
@sari-tech sari-tech deleted the Assignment branch April 26, 2024 08:49
@sari-tech sari-tech restored the Assignment branch April 26, 2024 08:50
@sari-tech sari-tech reopened this Apr 26, 2024
@sari-tech sari-tech changed the title Assignment 1 - Shell commands - submission Homework1 - Shell commands - submission Apr 26, 2024
@sari-tech
Copy link
Owner Author

@dtxe
@julia Gallucci
@michaelA drouillard

Copy link

@michaeladrouillard michaeladrouillard left a comment

Choose a reason for hiding this comment

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

Close!
3: You need to create 5 different files in each directory. You could do this in an automated way using a for loop like this:
for dir in dir1 dir2 dir3 dir4 dir5; do for i in {1..5}; do echo "I love data" > "$dir/file$i.txt" done done You can learn more about for loops here: https://www.cyberciti.biz/faq/bash-for-loop/

  1. Also close! If you want to display the contents in detail, you would do ls -l dir1/ dir2/ dir3/ dir4/ dir5/

  2. You want to also delete all the other directories:
    for dir in dir2 dir3 dir4 dir5; do rm "$dir"/*.txt done and then grep -L 'machine learning' dir1/*.txt | xargs rm

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.

2 participants