Skip to content

Commit

Permalink
Merge branch 'assignment' of https://github.com/drop2jyoti/shell into…
Browse files Browse the repository at this point in the history
… assignment
  • Loading branch information
drop2jyoti committed Aug 23, 2024
2 parents 5f55796 + 3b2e1d1 commit b9a359a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions 02_activities/assignments/assignment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,17 @@ set -x
cat dir2/file3.txt
# 6. Delete file4.txt
rm dir2/file4.txt
mkdir dir{1..5}
# 2. List the contents of the parent directory to verify the presence of the 5 directories
ls
# 3. Create 5 text files in dir2 named file1, file2, file3, file4, and file5
for f in file{1..5}; do touch dir2/$f.txt; done
# 4. Append the words "Hello world" to dir2/file3
echo "Hello world" >> dir2/file3.txt
# 5. Verify that file3 contains the words "hello world" by printing the contents of the file in the terminal
cat dir2/file3.txt
# 6. Delete file4
rm dir2/file4.txt
# 7. Delete directories dir4 and dir5 including all their contents (if any)
for dir in dir{4..5};
do rm -r "$dir"
Expand Down

0 comments on commit b9a359a

Please sign in to comment.