Removing back quotes from string in CSH

Hello,
I am using csh to read a text file and save its words into variable $word in a foreach loop. These words have small back quotes ` as integral parts of them, for example, one word would be `abc`, another would be `xyz1` etc... These quotes are always the first and last characters of the variable $word. I need to remove these symbols and just keep abc or xyz1.

I tried this code in my csh:
set SortedID = $word
set SortedID = `echo $word | cut -d '`' -f 2`

Obviously it fails because of bad nested use of `, I should probably use an escape character in my '`', but changing it to '\`' did not work. In both cases, with or without the back slash, I get the error:

Unmatched '.

This same code does exactly what I want directly on the Linux shell, since I don't need the back cote to invoque it as I do from csh. Is there another escape character I can use? or maybe there is a different solution all together? Thanks

Use a real scripting shell:

Top Ten Reasons not to use the C shell
Csh problems
Csh Programming Considered Harmful

The fact that csh is very limited should not prevent a talented programmer from finding a solution.

Here's what I came up with: I made a perl script that takes any word and strips the back quote characters from it (using regular expression replacement). In my csh I just do this:

set SortedID = `somepath/RemoveBackQuote.pl $word`

instead of the failing:
set SortedID = `echo $word | cut -d '`' -f 2`

Works like a charm!

A talented programmer would use a real programming language.

You made my point: csh just cannot do some things; you have to use another language.

In the UNIX shell, your problem can be solved trivially without using any external command, not even cut.

Thanks cfajohnson for the advise. I actually read in many places that csh is not good. I am new to Linux, the only reason I use csh is that the guy who taught me Linux also gave me some scripts in csh, and I started expanding them to write my own codes similar to what I do directly on the shell... Now my codes got too big!

Which shell do you suggest I switch to? tcsh? I'd like a script language as close as possible to direct shell commands (and if possible to csh), so that I don't suffer much learning the new tricks. Best!

tcsh is essentially the same as csh when it comes to scripting, but it is much better at the command line.

You don't want anything close to csh for scripting.

Use bash at the command line and POSIX shell for scripting. That way you use the same command syntax both at the command line and in your scripts.