Hello,
AIM: Need to test for the presence of some files (*.F) in a certain directory.
having a problem with this line is ksh:
if test `ls $SOMEDIR/dir/*.F \
2>/dev/null|wc -w` -eq 0
Basically testing for the presence of *.F files in the specified directory. If the return code from 'wc -w' is equal to 0 then no *.F exist
BUT, ls can fail if the command line is too long.
Fails with ..
sh-42 sh: arg list too long.
Could use the find command:
find $SOMEDIR/dir/*.F
along with the word count stuff, but then find is recursive and searches lower subdirectories (which I dont want). I cant find a command / option to use with 'find' to force it to only search that dir.
Any idea
Thanks in advance
E.