Originally Posted by Praveen waliitagi
I did set $xyz variable in my script but still i'm facing the same issue.
Any other suggestions would be helpful
It seems that in your script $xyz is being treated as a literal string, and not a variable identifier (this is what I eluded to when I wrote "nesting" of variables). There may be some dirty way around this but, I'm no (t)csh expert, having escaped it early in my career, so I don't know what it may be.
My first advice would be to abandon (t)csh for scripting (and for interactive use if possible).
My second piece of advice would be to rethink what you are actually trying to do, since I suspect there is a much simpler way to achieve the desired end result.