From 582ced090f5a19183a9430c2b58698476ac6c3c0 Mon Sep 17 00:00:00 2001 From: Thomas Constans Date: Fri, 20 May 2022 10:24:52 +0200 Subject: [PATCH] solution --- good.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 good.sh diff --git a/good.sh b/good.sh new file mode 100644 index 0000000..5e2ebc1 --- /dev/null +++ b/good.sh @@ -0,0 +1,13 @@ +#! /bin/bash + +set -eu + +IFS=$'\n\t' + +test $# -eq 1 || exit 1 + +[ -d ${1:-} -o -f ${1:-} ] || exit 2 + +[[ $1 =~ \.\. ]] && exit 3 + +echo rm -f $1