8

I am doing this on my script:

set Cnt1 =`echo $Cnt | awk '{print $1}'`
set Cnt2 =`echo $Cnt | awk '{print $2}'`
set Cnt3 =`echo $Cnt | awk '{print $3}'`

I am getting a error saying " set: Variable name must begin with a letter." Can someone tell me what I am doing wrong.. Cnt got value like this:

Cnt = 1 1 1
CharlesB
  • 86,532
  • 28
  • 194
  • 218
Jack
  • 785
  • 4
  • 12
  • 19

1 Answers1

9

You must remove space between Cnt and =

set Cnt1=`echo $Cnt | awk '{print $1}'`
set Cnt2=`echo $Cnt | awk '{print $2}'`
set Cnt3=`echo $Cnt | awk '{print $3}'`

Please leave (t)csh, it's awful, and read Top Ten Reasons not to use the C shell!

CharlesB
  • 86,532
  • 28
  • 194
  • 218