Browse Source

feat(file-struct): add subject, test and solution for new a exercise

DEV-4017-prototypes-exercise-1-animals
miguel 2 years ago committed by MSilva95
parent
commit
e3d8cd9516
  1. 16
      sh/tests/file-struct_test.sh
  2. 0
      sh/tests/solutions/struct/3/text.txt
  3. 0
      sh/tests/solutions/struct/4/text2.txt
  4. 0
      sh/tests/solutions/struct/A/text3.txt
  5. BIN
      sh/tests/solutions/struct/done.tar
  6. 46
      subjects/file-struct/README.md

16
sh/tests/file-struct_test.sh

@ -0,0 +1,16 @@
#!/usr/bin/env bash
# Unofficial Bash Strict Mode
set -euo pipefail
IFS='
'
print_content() {
mkdir -p uncompressed
tar -xpf done.tar -C uncompressed
tree uncompressed
}
submitted=$(cd student/struct && print_content)
expected=$(cd solutions/struct && print_content)
diff <(echo "$submitted") <(echo "$expected")

0
sh/tests/solutions/struct/3/text.txt

0
sh/tests/solutions/struct/4/text2.txt

0
sh/tests/solutions/struct/A/text3.txt

BIN
sh/tests/solutions/struct/done.tar

diff.bin_not_shown

46
subjects/file-struct/README.md

@ -0,0 +1,46 @@
## File struct
In order to create new directories or folders in Linux or Unix-like operating systems you need to use the `mkdir` command. `mkdir` stands for “make directory.” you can use it like so:
```console
User-> mkdir my_folder
User-> ls
my_folder
```
### Instructions
Create the files and directories so that when you use the command `tree` below, the output will look like this:
```console
User -> tree struct/
struct/
├── 0
├── 1
├── 2
├── 3
   └── text.txt
├── 4
   └── text2.txt
├── 5
├── 6
├── 7
├── 8
├── 9
└── A
└── text3.txt
```
Once it is done, use the command below to create the file `done.tar` to be submitted.
```console
User-> tar -cf done.tar *
User-> ls
0 1 2 3 4 5 6 7 8 9 A done.tar
```
**Only `done.tar` should be submitted.**
**Tips:**
Use the command `man mkdir` to get more info.
Loading…
Cancel
Save