Csh Programming Considered Harmful

I have noticed a few posts asking questions about c shell scripting these past few days. This a good read for those that currently or are thinking about writing a csh script:

Csh Programming Considered Harmful

2 Likes

Most csh programmers that come here have been forced to use it at paycheck-point.

See also:
Top Ten Reasons not to use the C shell
Csh problems

2 Likes

agreed.

Can use bash. Would that be ok?

Yes, the bash shell is certainly better than csh or tcsh.

I like scripting in bash. It's close to POSIX, and a contender for ksh, which I haven't used a lot in the last few years, since I work almost exclusively on GNU/Linux kit.

My gripes about bash are a lack of floating-point arithmetic and a lack of ksh-style coprocesses (bash4 has a retarded coprocess implementation, IMNSHO). Other than that, it's grand, and available on a lot of platforms, if not already preinstalled.

I agree with you as you say. I do need to do floating point calculations and use relational operators on floating point numbers. Playing with bc or awk gets scripts a bit lengthy even to do simple things.

how to use foreach loop

Don't.

Use a real shell.