tags:

views:

18

answers:

1

hello everyone I have 3 files: engine script

#! /bin/tcsh -f

cat $1 |./hello

hello script

#! /bin/tcsh -f

set line1 = ($<)

    while (${#line1} != 0)
     set line2 = ($<)
     set first1 = $line1[1]
     set first2 = $line2[1]
     if( $first1 == $first2) then
      echo $first1 $line1[2] $line2[2]
      set line1 = ($<)
     else                 
      echo $first1 $line1[2] 0
      set line1 = $line2     <- problem here, but why?
     endif
    end   

file for input

mba 30
mba 70
er 10
er 90
ma 20
ma 80
mt 100
al 35
al 65
eg 100
el 100
ez 10
ez 90
an 100
ews 30
rews 70
ar 23
ar 77
esa 45
esa 55

my script seems to be right but I receive an error:

mba 30 70
er 10 90
ma 20 80
mt 100 0
set: Variable name must begin with a letter.

any ideas why? thanks in advance

A: 

I found it: set line1 = ($line2) right answer

rookie