I am using Ubuntu 9.10.
There aren't really a lot of error messages. The thing is that even if there isn't any folder or file which has the name of a user, when root runs the program, behaves like there is a folder or a file with the name of a user, and executes ./cleaner, no ./runit as it should be.
---------- Post updated at 02:17 AM ---------- Previous update was at 01:08 AM ----------
Ok guys, I solved the problem. The problem was that if the $user3 for example was an empty string returns true value in the command if [ -s "$currentpath"/$user3 ]; then mpla mpla mpla
so i had some ifs to check if the $userX variables were an empty string, and if they were, then the program avoids even to search for them in the current directory. And that worked just fine
Many thanks to all of you for your valuable help!