commit 6a98e5b91a4448ef609f547806f43d5862fb3cff
Author: David Voznyarskiy <31452046-davidvoz@users.noreply.gitlab.com>
Date: Tue Jan 13 11:44:03 2026 -0800
exercise tar handling added
diff --git a/exercises/30_tar.sh b/exercises/30_tar.sh
new file mode 100644
index 0000000..11c4a0e
--- /dev/null
+++ b/exercises/30_tar.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+# tar is another GNU compression tool that will be more likely used.
+# It's more often used in compression of multiple files and folders.
+# Same as before, using the --help option, try to find the problem with
+# the command below. Don't worry about deleting the .tar.gz file.
+
+tar -czf exercises/ tests/ shelllings.sh shelllings.tar.gz
diff --git a/tests/30_tar.sh b/tests/30_tar.sh
new file mode 100644
index 0000000..09e8f60
--- /dev/null
+++ b/tests/30_tar.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+set -eu
+RED="\033[31m"
+GREEN="\033[32m"
+RESET="\033[0m"
+
+cleanup() {
+ rm *.tar.gz
+}
+trap cleanup EXIT
+
+failed() {
+ printf "${RED}Failed${RESET}\n"
+ exit 1
+}
+
+sh exercises/30_tar.sh || failed
+
+[ -s shelllings.tar.gz ] || failed
+
+file_size=$(du -s shelllings.tar.gz | awk '{print $1}')
+
+tar -czf check.tar.gz exercises/ tests/ shelllings.sh
+
+diff check.tar.gz shelllings.tar.gz || failed
+
+printf "${GREEN}Passed${RESET}\n"