csh script doubt

Hi,

I need to execute output one command in csh.

Eg:

#!/bin/csh

set smal = "set count = 1"
grep "Tot" in_file | sed "s/Tot/$smal/g"

In the above script, i have set the smal variale as "set count = 1".

My desired output like:

$echo count

should show as 1.

How to set the variable's variable into set command...

Thanks in advance,
Vasanth

---------- Post updated at 07:14 AM ---------- Previous update was at 07:02 AM ----------

how to set the variable value...

---------- Post updated at 07:18 AM ---------- Previous update was at 07:14 AM ----------

anybody there to help me..

What are you trying to achieve exactly?

What you have done there is store the string 'set count = 1' in the variable 'smal'. You haven't declared 'count' as a variable hence why you cannot echo the value of 'count'.