You have two problems here: the
$1 part of the awk command and the brackets
{}. To solve the brackets issue (since they have a special meaning in C-shells) you have to put double quotes around the variable name in the eval command:
The $1 part is the more difficult, since in C-shells you cannot escape the dollar sign using a backslash, as you should do in bash. You have to escape it using single quotes, but since the statement contains other quotes, it's difficult to see what to escape and what not. As a workaround I'd split the command in more parts, leaving the $1 alone:
Code:
#!/bin/csh
set filename=file.dat
set num=10
set partone="more $filename | grep -n 'RUN ("
set parttwo="' | awk -F ':' '{print "
set field='$1'
set partthree="}'"
set numone="$partone$num$parttwo$field$partthree"
eval "$numone"