programming Bourne vs. tcsh

programming Bourne vs. tcsh

Post by Rob » Fri, 24 Aug 2001 06:33:03



I know Bourne shell programming pretty well, but my boss asked me to write my
scripts in tcsh cause that's what people use at my company. When I looked for
tutorials though, they all warned heavily against using tcsh for programming,
but I could not understand why. Anyone want to shed some light on this for me?
What should I tell my boss ?
 
 
 

programming Bourne vs. tcsh

Post by David Masterso » Fri, 24 Aug 2001 06:57:40


Quote:>>>>> "nospam" == nospam  <Rob> writes:
> I know Bourne shell programming pretty well, but my boss asked me to
> write my scripts in tcsh cause that's what people use at my
> company. When I looked for tutorials though, they all warned heavily
> against using tcsh for programming, but I could not understand
> why. Anyone want to shed some light on this for me?  What should I
> tell my boss ?

Point him at http://language.perl.com/versus/csh.whynot (after reading
it yourself).  There is a certain amount of justification for using
what everyone else is using in the company.  However, the cost of
using the wrong tool for the job _*may*_ outweigh that.

--
David Masterson
Sr. R&D Engineer
Synopsys, Inc.

 
 
 

programming Bourne vs. tcsh

Post by Willia » Sun, 26 Aug 2001 03:22:21



Quote:> I know Bourne shell programming pretty well, but my boss asked me to write
my
> scripts in tcsh cause that's what people use at my company. When I looked
for
> tutorials though, they all warned heavily against using tcsh for
programming,
> but I could not understand why. Anyone want to shed some light on this for
me?
> What should I tell my boss ?

My first scripts were written for tcsh, but I've abandoned
that for serious programming 'cause bourne is just so much
more flexible (and more common, though csh and tcsh are
widespread). The ability to create functions makes it worth
using if nothing else.

About the only feature of tcsh scripting I missed was 'goto'
and I devised a more maintainable, replacement for bourne
shell. (Yes, I really did need a goto-like functionality,
but using case with a pseudo-program counter is much nicer.)

All that said, I still prefer tcsh as my user shell. If that's
what your boss is getting at, then you can assure him that
just because the users want to interact with tcsh, doesn't
mean the scripts can't be bourne shell. (You will need a tcsh
wrapper to set environment variables in the user's environment,
but that's not hard. Your bourne script could output them to
stdout where tcsh can capture and set them, or have it write
them to a file that tcsh can source.) -Wm

 
 
 

1. NIS and ksh vs. chs vs. tcsh vs. etc.

We are using various models of Suns, H-P 9000s, and SGIs under NIS, aka
Yellow Pages).  I would like to use Kron Shell as my default login shell
on those computers that have it, but the older Sun OS does not.

My Sys Admin is telling me that this is not possible under NIS, thus I must
use the C Shell since it is the only shell that is supported on all of the
machines.  Doing a little reading on the man pages, I think that he is
blowing smoke.  He said also that he "needed to occasionally copy the password
file around to the NIS nodes and my having a non-standard default shell would
not allow him to do this" (or words to this effect).

I've tried to use chsh and passmgmt (depending on which UNIX) to
change my default shell on various nodes, but I get "permission
denied" or no message but also no effect.

What man pages can I print out to show this Sys Admin person, in order
to convince him that what I want to do is one of the original intents
of NIS and doesn't mess up his "copying of the passwd file".  I just
want to set the Korn Shell as my default shell on our SGIs, H-Ps, and
Solaris Suns & get on with my life.

--
Roy Kannady                                         Ignorance is curable;
Martin Marietta Astronautics                           Stupidity is terminal.

2. Frustrated with installing new apps

3. /bin/tcsh vs /usr/local/bin/tcsh

4. pppd exit code 10

5. #!/bin/tcsh vs. #! /bin/tcsh

6. Looking for malloc sources, references & test-suites.

7. Realtek 8029 & ip masq problem...

8. FreeBSD/OS X: tcsh vs bash vs zsh?

9. xterm vs. tcsh vs. vi

10. sh vs csh vs tcsh

11. modern shells...ksh vs. bash vs. tcsh, etc.

12. Linux vs OS2 vs NT vs Win95 vs Multics vs PDP11 vs BSD geeks