Linux Script help

Hi Everyone , have a nice day
given below is a simple linux script
but its first part is not working ( variable k assignment ) , while second loop is working fine
can anyone help me out with this

#!/bin/sh
echo "Enter Date"
read date1
for i in 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23
do
k = `grep -i success /var/seamless/spool/tdr/ERS_200804$date1$i* | wc -l`
echo $k
done
echo "                "
for i in 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23
do
grep -i fail /var/seamless/spool/tdr/ERS_200804$date1$i* | wc -l
done

Thanks in Anticipation

Remove the spaces surrounding the = when you assign the variable k. It should read
k=`grep -i....`

Remember you can put a "-x" at the end of your #!/bin/sh statement and it will run the script in debug

k =`grep -i success /var/seamless/spool/tdr/ERS_200804$date1$i* | wc -l`
echo $k
done

i have added -x for debug , not it is calculating value of k , but its not echoing it , what could possibly be wrong with echo $k
:frowning:

remove the space as allready suggested before...

k=`your code`

Worked :D:D
Thanks a bunch

Do you know how to make up the script "cp file1 file2"? If you don't know, do you know of anyone else that could help me? I need a response as soon as possible, I greatly appreciate any help you can give me.

Pls don't 'hijack' other people's threads - start a new thread.
Read the Rules of these forums FIRST.