The UNIX and Linux Forums  

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 03-25-2008
bigboizvince bigboizvince is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 11
c shell scripting

I'm a beginner in UNIX and am stuck on a problem.

1. I read the input from the user

2. next I grepped the input into a text file to see if there is a match, if there is the output would be sent to a file called "count" and it will either have a 1 for a match or 0 for no match.

3. my next problem is how could I call the number in the text file "count" to be placed in a variable which would be used in an IF Then statement that if a 1 exists it would echo an instruction and if it was 0 then it would move on to the next file to see if there is a match.

for example I want something that would work like this "varname= cat count"