From a8124e4683da4f8a646ceea0c488ffcf2622d1c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Mon, 22 Apr 2019 20:49:56 +0200 Subject: [PATCH] This one is legit --- scripts/dummy | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 scripts/dummy diff --git a/scripts/dummy b/scripts/dummy new file mode 100755 index 0000000..1423b2a --- /dev/null +++ b/scripts/dummy @@ -0,0 +1,14 @@ +#!/usr/bin/bash + +# Remplace le contenu d'un dossier par un fichier texte +# relatant son arborescense + +dir="$(echo "$1" | sed 's|/\+||')" +if [ -d "$dir" ]; then + TEMP=$(mktemp) + tree -a -p -D -n "$dir" > "$TEMP" + mv "$dir" "$dir.bkp" + mv "$TEMP" "$dir" +else + echo "$dir n'est pas un dossier" +fi