in reply to need help on shell scripting
Based on your previous post maybe you should read the classic Csh Programming Considered Harmful by Tom Christiansen. And I strongly urge you to use Perl instead of Unix shell. :)