Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented Shell Tasks #3

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open

Implemented Shell Tasks #3

wants to merge 29 commits into from

Conversation

AhmadAwab98
Copy link
Owner

@AhmadAwab98 AhmadAwab98 commented Nov 7, 2023

Includes

  1. search a file in a given folder
  2. create files in a folder and then copy files into another folder and then swap the folder names
  3. display local IP address
  4. change PS1
  5. print a given string in box of given char
  6. download images in the given path with the given name and resolution
  7. automate downloading image

Added 'README.md' for good understanding.
Created file.txt with Helo world in it.
Changed world to everyone.
Created .gitignore and added ignore_folder into .gitignore.
Added .sh files of tasks 1-6 to Github.
Added .sh files of cronjob task onto git.
Created .dotfile to modify PS1 as asked.
Added .sh files of tasks 1-6 to Github.
Added .sh files of tasks 1-6 to Github.
Added .sh files of tasks 1-6 to Github.
Added .sh files of tasks 1-6 to Github.
Added .sh files of tasks 1-6 to Github.
Added .sh files of cronjob task onto git.
Added .sh files of cronjob task onto git.
Added .sh files of cronjob task onto git.
Updated task9 for copying the script to home.
Updated task 8 to add time to the image made.
Task 7 was redundant, so, removed
Changes were made in the tasks that are as follows:
- Added comments
- Deleted task 7 as it was redundant.
- Updated task 8, so that it can run without arguments.
Updated README.md to add following details:
- A brief overview of the scripts
- Execution information of the scripts
Deleted task9 to
- Rename task8 to task7
- Rename task9 to task8
Updated tasks as follows:
- updated the comments
- renamed task 8 and 9 to task 7 and 8
@Ammar022
Copy link

Ammar022 commented Nov 7, 2023

Includes

  • Task 1 searches a file in a given folder
  • Task 2 create files in 1 folder and then copy files into another folder and then swap the folder names
  • Task 3 displays local IP address
  • Task 4(.dotfile) changes PS1
  • Task 5 prints a given string in box of *
  • Task 6 prints a given string in box of given char
  • Task 7 downloads images in the given path with the given name and resolution
  • Task 8 starts a cronjob of Task 7

make includes a heading.
remove Task 1, Task 2 ... from start of points.

@Ammar022
Copy link

Ammar022 commented Nov 8, 2023

Includes

  • Searches a file in a given folder
  • Create files in 1 folder and then copy files into another folder and then swap the folder names
  • Displays local IP address
  • Changes PS1
  • Prints a given string in box of *
  • Prints a given string in box of given char
  • Downloads images in the given path with the given name and resolution
  • Starts a cronjob of Task 7
  • make every first character of point to a small letter

  • Change Create files in 1 folder and then copy files into another folder and then swap the folder names to create files in a folder and then copy files into another folder and then swap the folder names

  • don't use s at the end of the first words

@Ammar022
Copy link

Ammar022 commented Nov 8, 2023

Give this PR a proper name. Read about PR naming conventions.

Copy link

@Ammar022 Ammar022 left a comment

Choose a reason for hiding this comment

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

Kindly make requested changes in all other places where required.

README.md Outdated

The project contains 8 distinct tasks.
- Task 1 focuses on searching for a specific file within a designated folder
Copy link

Choose a reason for hiding this comment

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

Suggested change
- Task 1 focuses on searching for a specific file within a designated folder
- task 1 focuses on searching for a specific file within a designated folder

README.md Outdated
The project contains 8 distinct tasks.
- Task 1 focuses on searching for a specific file within a designated folder
- Task 2 is responsible for creating files in one folder, copying them to another folder, and swapping the names of the two folders.
Copy link

Choose a reason for hiding this comment

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

Suggested change
- Task 2 is responsible for creating files in one folder, copying them to another folder, and swapping the names of the two folders.
- task 2 is responsible for creating files in a folder, copying created files to another folder, and swapping the names of the two folders

Copy link

Choose a reason for hiding this comment

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

Make changes in the next tasks accordingly.

README.md Outdated
```

- Task 2, 8 and Task 3 is a simple task. To run this you only have to right the name with leading ./
Copy link

Choose a reason for hiding this comment

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

Suggested change
- Task 2, 8 and Task 3 is a simple task. To run this you only have to right the name with leading ./
- To execute tasks 2, 3 & 8

README.md Outdated
Comment on lines 61 to 64
```
./task7 -p path
```
Copy link

Choose a reason for hiding this comment

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

Suggested change
- In task 7 you can give only name or path or resolution in the following way:
```
./task7 -p path
```

@@ -0,0 +1 @@
PS1="[\t] \w > "
Copy link

Choose a reason for hiding this comment

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

Add comments

Copy link

Choose a reason for hiding this comment

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

use proper commenting format in this file

Scripts/task2.sh Outdated

echo "creating files"

# creating 4 files in task2 folder
Copy link

Choose a reason for hiding this comment

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

Suggested change
# creating 4 files in task2 folder
# creating files in task2 folder

Scripts/task2.sh Outdated

echo "creating folder task2_temp"

# making 2nd folder task2_temp in task2 folder
Copy link

Choose a reason for hiding this comment

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

Suggested change
# making 2nd folder task2_temp in task2 folder
# making folder task2_temp in task2 folder

Scripts/task2.sh Outdated

echo "copying files"

# copying 3 files in task2 into task2_temp
Copy link

Choose a reason for hiding this comment

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

Suggested change
# copying 3 files in task2 into task2_temp
# copying files in task2 into task2_temp

file.txt Outdated
Copy link

Choose a reason for hiding this comment

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

What is the purpose of adding this file here?

@AhmadAwab98 AhmadAwab98 closed this Nov 8, 2023
@AhmadAwab98
Copy link
Owner Author

Ok

@AhmadAwab98 AhmadAwab98 reopened this Nov 8, 2023
@AhmadAwab98 AhmadAwab98 changed the title Updated tasks as asked Project: Search files, swap folder names, displays IP, customize PS1, box prints, download images and schedule tasks Nov 8, 2023
file.txt had no purpose
Updated README.md to add following details:
- A brief overview of the scripts
- Execution information of the scripts
- Made more readable
- Comments formatting was corrected in task1
- Comments were made more reader friendly
Created .dotfile to modify PS1 as asked.
@AhmadAwab98 AhmadAwab98 changed the title Project: Search files, swap folder names, displays IP, customize PS1, box prints, download images and schedule tasks Added shell tasks and updated readme Nov 8, 2023
@AhmadAwab98 AhmadAwab98 changed the title Added shell tasks and updated readme Implementations Shell Tasks Nov 8, 2023
Updated README.md to add following details:
- A brief overview of the scripts
- Execution information of the scripts
- Made more readable
@AhmadAwab98 AhmadAwab98 changed the title Implementations Shell Tasks Implementing Shell Tasks Nov 8, 2023
@AhmadAwab98 AhmadAwab98 changed the title Implementing Shell Tasks Implemented Shell Tasks Nov 8, 2023
Copy link

@Ammar022 Ammar022 left a comment

Choose a reason for hiding this comment

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

remove extra spaces & increase code readability

Scripts/task1.sh Outdated
local folder=$2
# looping through the directory
for entry in "$folder"/*; do
# if directory then call the function again
Copy link

Choose a reason for hiding this comment

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

write a proper comment. " if directory then " ?

Scripts/task1.sh Outdated
# if directory then call the function again
if [ -d $entry ]; then
search_file "$file" "$entry"
# if file then search if file is the one we were looking for
Copy link

Choose a reason for hiding this comment

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

write proper comment

Scripts/task7.sh Outdated
Comment on lines 50 to 53
# site for downloading image
site="https://source.unsplash.com/$res/"
# downloading the image
wget -q -O "$directory" $site
Copy link

Choose a reason for hiding this comment

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

Suggested change
# site for downloading image
site="https://source.unsplash.com/$res/"
# downloading the image
wget -q -O "$directory" $site
# site for downloading image
site="https://source.unsplash.com/$res/"
# downloading the image
wget -q -O "$directory" $site

Scripts/task7.sh Outdated
Comment on lines 48 to 49


Copy link

Choose a reason for hiding this comment

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

Suggested change

Copy link

@Ammar022 Ammar022 left a comment

Choose a reason for hiding this comment

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

README.md issues

README.md Outdated
### Execution

- Before actually executing any task you have to change the mode of that script to execution:
Copy link

Choose a reason for hiding this comment

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

Suggested change
- Before actually executing any task you have to change the mode of that script to execution:
Before actually executing any task you have to change the mode of that script to execution:

README.md Outdated
## Description

The project contains 8 distinct tasks.
Copy link

Choose a reason for hiding this comment

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

Suggested change
The project contains 8 distinct tasks.
The project contains 8 distinct tasks:

README.md Outdated
The project contains 8 distinct tasks.
- task 1 focuses on searching for a specific file within a designated folder
- task 2 is responsible for creating files in a folder, copying created files to another folder, and swapping the names of the two folders.
Copy link

Choose a reason for hiding this comment

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

don't put full stop at end if you are using bullets.

Updated README.md to add following details:
- A brief overview of the scripts
- Execution information of the scripts
- Made more readable
- Added proper comments
- Made task7 more readable
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