I needed a bash script that, given a path, would detect empty directories. More specifically, I wanted the script to only list the highest parent directory (in other words, if there were no files anywhere beneath parent and within parent's subdirs, then just output the parent).<p>I figured this would be quite simple, but since I was already working with a AI chat, I gave it a prompt with the rules and objective. After 30 mins of so, I switched to DeepSeek, thinking it would output a solution on the first try. Nope. Not even after more than 90 minutes of back and forth with debugging.<p>I was very surprised. As an aside, I solved it on my own in a simple two step process:<p>Step 1: Use find $dir -type d with the sorted output input into an array.<p>Step 2: Set parent to 'start'; Iterate the sorted array and continue the loop if the array_ele was a child of parent - otherwise echo $dir and set parent=$dir<p>Easy Peasy. But quite surprised both AI chats struggled to find a solution in bash (I limited the AI to bash).