Set command error in c shell script

I do 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 get the error "set: Variable name must begin with a letter". Can someone tell me what I'm doing wrong. Cnt got a value similar to this:

 Cnt = 1 1 1 
+6
source share
1 answer

You must remove the 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, this is terrible and read Ten reasons not to use the C shell !

+6
source

Source: https://habr.com/ru/post/892708/


All Articles