my expect script copies a bash script onto a remote server
it the exectues thisscript on the remote server

i define a variable within the script i.e.
my for loop in the script only works if i use the directory name and not the variable

DOESNT WORK:-
        for H  in `cd $WDIR ; ls ${SITE}*log*gz | awk -F_ '{print $1}' |sort|uniq`
        do

WORKS:-
        for H  in `cd ; ls ${SITE}*log*gz | awk -F_ '{print $1}' |sort|uniq`
        do