#!/bin/bash SOURCE_DIR="output" TARGET_DIR="target" replicate_structure() { local source="$1" local target="$2" for item in "$source"/*; do if [ -d "$item" ]; then local dir_name=$(basename "$item") mkdir -p "$target/$dir_name" replicate_structure "$item" "$target/$dir_name" elif [ -f "$item" ]; then if [ -s "$item" ]; then local file_name=$(basename "$item") touch "$target/$file_name" fi fi done } replicate_structure "$SOURCE_DIR" "$TARGET_DIR" echo "Replication complete from $SOURCE_DIR to $TARGET_DIR"