From 352636f3e9ad1ac2573587b6f1beced38eb67bfd Mon Sep 17 00:00:00 2001
From: Pedro Folloni Pesserl <fpesserl7@gmail.com>
Date: Sun, 19 Feb 2023 23:02:00 -0300
Subject: [PATCH] start part 2

---
 tshell/tshell_p2.sh | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/tshell/tshell_p2.sh b/tshell/tshell_p2.sh
index a9bf588..b5dd8f9 100755
--- a/tshell/tshell_p2.sh
+++ b/tshell/tshell_p2.sh
@@ -1 +1,19 @@
 #!/bin/bash
+
+if [ $# -ne 2 ]; then
+	>&2 echo "Uso: <dcsv> <dsin>"
+	exit 1
+fi
+
+testa_se_diretorio() {
+	if [ ! -d $1 ]; then
+		>&2 echo "Erro: $1 não é um diretório."
+		exit 1
+	fi
+}
+
+DCSV=$1
+DSIN=$2
+
+testa_se_diretorio $DCSV
+testa_se_diretorio $DSIN
-- 
GitLab