aboutsummaryrefslogtreecommitdiff
path: root/challenge-203/spadacciniweb/bash/ch-2.bash
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-203/spadacciniweb/bash/ch-2.bash')
-rw-r--r--challenge-203/spadacciniweb/bash/ch-2.bash12
1 files changed, 12 insertions, 0 deletions
diff --git a/challenge-203/spadacciniweb/bash/ch-2.bash b/challenge-203/spadacciniweb/bash/ch-2.bash
new file mode 100644
index 0000000000..022c932d20
--- /dev/null
+++ b/challenge-203/spadacciniweb/bash/ch-2.bash
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+echo -n "path source: "
+read SOURCE
+
+[ -d "$SOURCE" ] || { echo "$SOURCE directory does not exist."; exit 1; }
+
+echo -n "path target: "
+read TARGET
+[ -d "$TARGET" ] || { echo "$TARGET directory does not exist."; exit 1; }
+
+rsync -av -f"+ */" -f"- *" $SOURCE/ $TARGET