The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 04-15-2008
aahhhchoooo aahhhchoooo is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 1
Quote:
Originally Posted by Dastard View Post
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

HTML Code:
#!/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