diff --git a/tshell/tshell_p2.sh b/tshell/tshell_p2.sh index a9bf588e2f88457fdf73ac7361ef1d596fb81453..b5dd8f98840fd0917979923b6876ed681fe19b63 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