#!/bin/bash

function explore_dir() {
    local dir=$1
    local indent=$2

    for item in "$dir"/*; do
        if [ -d "$item" ]; then
            echo "${indent}Directory: $(basename "$item")"
            explore_dir "$item" "  $indent"
        elif [ -f "$item" ]; then
            echo "${indent}File: $(basename "$item")"
        fi
    done
}

if [ "$1" == "" ]; then
    echo "Usage: explore "
    echo "Explore the contents of the specified directory recursively."
else
    if [ -d "$1" ]; then
        explore_dir "$1" ""
    else
        echo "Error: '$1' is not a valid directory."
    fi
fi