From e3d8cd9516e9ab78b80c90240dc3457f20188362 Mon Sep 17 00:00:00 2001 From: miguel Date: Wed, 30 Nov 2022 17:18:51 +0000 Subject: [PATCH] feat(file-struct): add subject, test and solution for new a exercise --- sh/tests/file-struct_test.sh | 16 +++++++++ sh/tests/solutions/struct/3/text.txt | 0 sh/tests/solutions/struct/4/text2.txt | 0 sh/tests/solutions/struct/A/text3.txt | 0 sh/tests/solutions/struct/done.tar | Bin 0 -> 10240 bytes subjects/file-struct/README.md | 46 ++++++++++++++++++++++++++ 6 files changed, 62 insertions(+) create mode 100755 sh/tests/file-struct_test.sh create mode 100644 sh/tests/solutions/struct/3/text.txt create mode 100644 sh/tests/solutions/struct/4/text2.txt create mode 100644 sh/tests/solutions/struct/A/text3.txt create mode 100644 sh/tests/solutions/struct/done.tar create mode 100644 subjects/file-struct/README.md diff --git a/sh/tests/file-struct_test.sh b/sh/tests/file-struct_test.sh new file mode 100755 index 00000000..963b97f1 --- /dev/null +++ b/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") diff --git a/sh/tests/solutions/struct/3/text.txt b/sh/tests/solutions/struct/3/text.txt new file mode 100644 index 00000000..e69de29b diff --git a/sh/tests/solutions/struct/4/text2.txt b/sh/tests/solutions/struct/4/text2.txt new file mode 100644 index 00000000..e69de29b diff --git a/sh/tests/solutions/struct/A/text3.txt b/sh/tests/solutions/struct/A/text3.txt new file mode 100644 index 00000000..e69de29b diff --git a/sh/tests/solutions/struct/done.tar b/sh/tests/solutions/struct/done.tar new file mode 100644 index 0000000000000000000000000000000000000000..0386f4b9500de30df0b7026897d2858e74b2cd5f GIT binary patch literal 10240 zcmeI1!D_=W42JzEd4kolEo(dWQF;hvuwFJ7`uJ1QlK4_eDGGxAzF6QyHvbnzQWAH; zd_)~09CRY#*w53_Gy;`es0vHg>nL(9VPNx<=?3S&cK98JaQZ%;$DjK?|;Pq7WhNnweiwE+NIfTHzoM030 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.