#!/bin/bash# Function to delete the 'target' directory recursivelydelete_target() { local dir="$1" # Loop through all items in the current directory for item in "$dir"/*; do if [[ -d "$item" ]]; then # If the item is a directory, check if it's named 'target' if [[ $(basename "$item") == "target" ]]; then echo "Deleting directory: $item" rm -rf "$item" else # If not 'target', recurse into this directory delete_target "$item" fi fi done}# Start the recursive deletion from the current directorydelete_target "."# Check if the current directory itself is named 'target'if [[ $(basename "$PWD") == "target" ]]; then echo "The current directory is named 'target'. It cannot be deleted from within itself." echo "Please run this script from outside the 'target' directory if you wish to delete it."fi