#!/bin/bash

# Loop through all zip files in the current directory
for zip_file in *.zip; do
    # Check if there are any zip files in the directory
    if [[ -e "$zip_file" ]]; then
        echo "Unzipping $zip_file..."
        
        # Unzip the file
        unzip "$zip_file"
        
        # Check if the unzip command was successful
        if [[ $? -eq 0 ]]; then
            echo "Successfully unzipped $zip_file. Deleting the original zip file..."
            rm "$zip_file"
        else
            echo "Failed to unzip $zip_file. Skipping deletion."
        fi
    else
        echo "No zip files found in the current directory."
        break
    fi
done
