jeudi 27 août 2015

Check multiple files exist in directory

How to find multiple files present in a directory in ksh (onAIX)

I am trying below one:

if [ $# -lt 1 ];then
    echo "Please enter the path"
    exit
fi
path=$1
if [ [ ! f $path/cc*.csv ] && [ ! f $path/cc*.rpt ] && [ ! f $path/*.xls ] ];then
    echo "All required files are not present\n"
fi

I am getting error like check[6]: !: unknown test operator //check is my file name.

what is wrong in my script. Could someone help me on this.

Aucun commentaire:

Enregistrer un commentaire