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 -->
  #1 (permalink)  
Old 05-23-2002
barisgultekin barisgultekin is offline
Registered User
  
 

Join Date: May 2002
Posts: 6
grep doesn't work within shell script?

I am trying to run the following code from a script file but it complains that syntax of (both instances of) grep is wrong.

When I copy and paste it to the terminal, it is OK. Any idea what the problem might be?


set i = `grep -c #define flags.h`

while ($i>20)
@ i--
my func (`cat flags.h | grep #define |sed -n '$i{p;q;}' `)
end


Thanks,
Baris