diff --git a/delete_Trash-1000.sh b/delete_Trash-1000.sh index 3a0cd89..41d0952 100644 --- a/delete_Trash-1000.sh +++ b/delete_Trash-1000.sh @@ -12,9 +12,10 @@ while [[ "$#" -gt 0 ]]; do shift done -# If no folder path is provided, prompt the user for it +# If no folder path is provided, exit with an error if [ -z "$folder_path" ]; then - read -p "Enter the path to the folder: " folder_path + echo "No folder path provided. Exiting." + exit 1 fi # Check if the provided path is valid @@ -35,13 +36,9 @@ else echo "$trash_folders" echo - # Ask for confirmation before deletion if -y is not provided + # If the -y option is not provided, automatically confirm deletion if [ "$auto_confirm" = false ]; then - read -p "Do you really want to delete all these folders? (y/n): " confirmation - if [[ "$confirmation" != "y" && "$confirmation" != "Y" ]]; then - echo "Deletion canceled." - exit 0 - fi + echo "Deleting all .Trash-1000 folders without confirmation..." fi # Loop through each found folder and delete it