Is there any script to convert sh to csh ?

Hi All

Is there anyone who have the script to covnert a sh sell script to csh and can share with me?

Thanks a lot!

Nick:b:

What would you want to do that?

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

Bourne has the ability to open files and read files and redirect file descriptors, csh doesn't. These fundamental operations have no translation.

Bourne can redirect loops too -- csh can't. Again, these fundamental things have no translation.

Bourne has quote operators which conceivably can let you quote nearly anything, csh's horrid quotes are full of special cases. There exist things which simply can't be quoted -- no matter what you do, csh tries to evaluate it as a statement. There's no working equivalent for this basic, indispensable feature.

They are not the same. It's like trying to translate perl into assembly language.

You'd be better off learning the Bourne shell. Any UNIX system has a bourne shell, even csh-happy ones like BSD -- they can't avoid it, too many things need it, and it's mandated by standard. And quite a few UNIX systems don't have csh at all.

Yes. Take a look at the sample sh2csh.csh script included with Hamilton C shell. (Google "sh2csh.csh".) It uses a series of sed scripts to do a basic conversion that you can then tweak. It assumes you're using Hamilton C shell, which has a lot of features not the original Unix csh, but I hope it may still be helpful as a starting point. I'm the author, so if you have questions, send me mail or give me a call.