From 49b7d5d30c07cfe84b8cc47f7ca40318d8dc85ce Mon Sep 17 00:00:00 2001 From: Aadit Agrawal Date: Fri, 17 Jan 2025 10:49:05 +0530 Subject: [PATCH] Update OS/bash/Week3/answers.md --- OS/bash/Week3/answers.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/OS/bash/Week3/answers.md b/OS/bash/Week3/answers.md index e69de29..e005a71 100644 --- a/OS/bash/Week3/answers.md +++ b/OS/bash/Week3/answers.md @@ -0,0 +1,14 @@ +## Answers for Lab 3 - OS + +1. `q1.sh` - `File or Folder check` -Using `echo` and `if-elseif-fi` statements. +2. `q2.sh` - `Filename Search` - Using `find` args, primarily `iname` for pattern matching and `-type> +3. `q3.sh` - `Extension Change` - `.txt` -> `.txt`. Mainly using `mv`, but `cut` was used with a deli> +4. `q4.sh` - `Arithmetic in echo` - `bc -l` is used for mathlib for arithmetic arg printed by `echo`. +5. `q5.sh` - `Directory with Custom Files` - application of basic `mkdir`, `cp`, `find` commands +6. `q6.sh` - `Start of the line mod` - `sed` args stacked to meet query requirements. +7. `q7.sh` - `Even Number Line deletion` - Uses `read` to parse through a file, and an iterating vari> + +### Additional Exercises +1. `addq1.sh` - `Prime Number Checker` - `if-else` and `for` loops. +2. `addq2.sh` - `Factorial` - `for` loop almost exclusively. +3. `addq3.sh` - `EvenFile vs Oddfile` - `read`, `if-else` and `while` loops