Ksh script: std Out/err

Hello gurus, this is part of my script:

 
ls -1 ${MyFile} >> ${dir_log}ListFile${Now}.tmp
FILENUM=`cat ${dir_log}ListFile${Now}.tmp| wc -l | awk '{print $1}'`>> /dev/null
if [ ${FILENUM} -lt 1 ]
then
        writeError "ERRORE: no file in directory for type ${FileName}!" >> ${LogFileName}
        Close 1
fi
 

but although it tries to

"> /dev/null"

to video it always appears:

CR_CHR_GSM_*.data.gz: No such file or directory

How to make?
Thanks

Try:

FILENUM=`cat ${dir_log}ListFile${Now}.tmp 2>/dev/null | wc -l | awk '{print $1}'`

the same message:

 
CR_CHR_GSM_*.data.gz: No such file or directory

Looking closer, the statement is dealing with filenames that end in .tmp and your error message is dealing with filenames that end in *.gz. So you are looking at the wrong statement. Maybe you need to put the redirect on the ls statement above it. Or more likely it's the wrong fragment of code entirely.

Your code can be simplified as shown by the following simple example:

MyFile='CR_CHR_GSM_*.data.gz'

if [[ $(ls -l $MyFile 2>/dev/null | wc -l | tr -d ' ') > 0 ]]
then
   echo "true"
else
   echo "false"
fi

always the same message!!!!!!

 
CR_CHR_GSM_*.data.gz: No such file or directory

It appears cause it is an error, so you have to redirect your stderr, not your stdout.

Can you try :

$ ksh ./your_script 2> ./err_log
$ cat err_log

br/gb

Please post the whole script.
Is this a continuation of your script to process 660,000 compressed files?