jb_daefo, that's a good solution for the immediate problem, I was doing that all day practicing (deleting the entire directory and create an new one, filing it with new data, etc, so that I don't screw up elsewhere) but than it came to me, there may be an need to *NOT* touch the directory and only remove the files with-in, etc or use only wild-cards style for whatever reason... Than all of a sudden, just hours ago, it got very interesting to me. For what , I don't know but now I'm hook. I always get stuck on stupid but it usually pay-off in the long run. Anyway, just after posting this questions, google FINALLY turn up a decent clue after all that searching, coming up with zip for a simple question, using 20 keywords or more: unbelievable!!!
This is really something:
http://xpt.sourceforge.net/techdocs/...dCheck/single/
The problem is how to point to my directory with-out all of that code. I tried lots of ways to replace/work around with [-z] with many test directory but still can't get it to work:
Code:
> check if there is any file exist in /home/my_directory
if [ -z "`ls`" ]
then
echo "no files found."
else
echo "files found."
fi