Operating System - Linux
1828483 Members
2788 Online
109978 Solutions
New Discussion

csh - the simplest solution ??

 
Dave Pointon
New Member

csh - the simplest solution ??

I'm intrigued ... how the translation of a bash shell script to c shell is the simplest solution to the stated problem.
5 REPLIES 5

Re: csh - the simplest solution ??

Hello,

what IS the stated problem ?
Why do you need to convert it ?
Dave Pointon
New Member

Re: csh - the simplest solution ??

Hi Stefan,

The problem as stated is to have the ability to produce (albeit simply) formatted text output from a bash/bourne/korn shell script (difficult to tell since all use the echo command). I have clear memories of C shell using the pring command to effect the same end - moreover, C shell commands are different to Bourne shell based commands - hence the translation.
Peter Kloetgen
Esteemed Contributor

Re: csh - the simplest solution ??

Hi Dave,

there is no way to "translate" to c-shell... But if you post your script we can perhaps help you here. UNIX- commands word the same in c- shell and other ones mostly, but if you need loops or something like that, you are right, there is a different syntax. So please post your script here if possible and we will try to help you.

Allways stay on the bright side of life!

Peter
I'm learning here as well as helping
Ted M Johnson_1
Frequent Advisor

Re: csh - the simplest solution ??

Whenever I see the words "produce formatted text" and "shell script" used together, I cringe.

Why not use PERL? It's faster than csh, more powerful than ksh, and is easier to learn than either ksh or csh.

If the job calls for a hammer, use a hammer - not a screwdriver. Know what I mean?

IMHO,

-ted
Gregory Fruth
Esteemed Contributor

Re: csh - the simplest solution ??

Writing a C shell script is NEVER the
right answer to a problem.

For a simple task, a ksh/sh-posix script
may be adequate. For more complex
tasks, you'll probably need to incorporate
some awk into the script or switch to all
awk. To do any kind of heavy lifting,
though, Perl is probably your best bet.

HTH