Re: Takes courage
"That's why you write the resulting commands into a file, which you inspect before running it. I also mentioned checking the results from the database for sane values"
And take the path variable that you've constructed and feed it to ls, just to see if what you expect happens.