It looks to me like gnu grep supports perl regex, but your unix one doesn't. gnu tools often have more features than other unix counterparts.
Personally, I'd avoid using grep altogether and restructure the code to do the matching entirely within the shell itself using its built-in pattern matching ability.
First of all, are you using bash, or another shell? And what version? I tried to avoid anything particularly bash-specific in the code below, but there might be some things that don't translate well into other shells.
I moved the line testing into a function that uses a case statement to generate a list of bad filenames. I've found that it's usually easier to store your filenames in a list before you start moving things around. Apologies in advance if I misunderstood your intentions in the code.
for file in `rsh emsun2 "ls /export/home/db_inputs/nt3_ws/"`; do
case `basename -- $file` in
# use '--' so that files beginning with '-' aren't seen as options
-*) echo "$file" ;;
\ *) echo "$file" ;;
BAD_SUM_CNT=`echo "$BAD_SUM_FILES"|wc -l`
if [ "$BAD_SUM_FILES" ];then
printf "\n" >> $FILE_LOG
for file in $BAD_SUM_FILES; do
echo "$file" >>$FILE_LOG
rsh emsun2 "mv -- "$file" /export/home/db_inputs/nt3_ws/bad_summary"
#edit: we need "--" here too.
echo "The above $BAD_SUM_CNT summaries are moved to bad_summary folder" >> $FILE_LOG
echo "No Summaries with bad file name ">> $FILE_LOG
Note: I had a difficult time testing this. Not having anything to rsh into, I had to use a local folder. But the files with spaces at the beginning weren't handled correctly until I changed the IFS to newline only. I don't know if this would be an issue for you. I usually change IFS any time a filename could contain spaces anyway--it's just easier that way.
Note also that bash recommends using $() instead of ` backticks for embedded commands. But again I purposely avoided it in the above code.