I have tried the following script to check for the presence of any files in a folder:
if (-r *) then
goto ZipMiscFiles
else
echo ""
echo " No Miscellaneous files found. Exiting program."
echo ""
exit
endif
The -r works fine with the wildcard in combo with other letters such as:
if (-r *[Jj][Ss]) ...
It does not work with the asterisk alone. How do I check for the presence of files without using ls, which prints an error message if no files are present?
Is ZipMiscFiles being used as a directory name? In code previous to what I've shown above, I determine the existence of and cd into a directory called "Miscellaneous". I'm thinking in that case that your code might instead be:
is_file ./* || {
meaning that it is to look in the current directory (and only the current directory even if there are other directories beneath it). Am I right?