home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / unix / question / 15030 < prev    next >
Encoding:
Text File  |  1992-12-29  |  2.2 KB  |  58 lines

  1. Newsgroups: comp.unix.questions
  2. Path: sparky!uunet!munnari.oz.au!cs.mu.OZ.AU!munta.cs.mu.OZ.AU!fjh
  3. From: fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON)
  4. Subject: Re: The Revenge of CSH
  5. Message-ID: <9236508.12113@mulga.cs.mu.OZ.AU>
  6. Sender: news@cs.mu.OZ.AU
  7. Organization: Computer Science, University of Melbourne, Australia
  8. References: <Bzz748.GDK@csn.org> <HUANG1.92Dec29101449@husc11.harvard.edu>
  9. Date: Tue, 29 Dec 1992 21:12:26 GMT
  10. Lines: 46
  11.  
  12. huang1@husc11.harvard.edu (Howard Huang) writes:
  13.  
  14. >bazyar@teal.csn.org (Jawaid Bazyar) writes:
  15. >
  16. >     I am continually shocked and dismayed to see people not have
  17. >   command line editing, arrow-key history, job control, or many
  18. >   of the other things that csh (tcsh) provides and /bin/sh does not.
  19. >
  20. >Most people (I think) agree that csh is better as an _interactive_
  21. >shell than sh.  The tchrist article specifically focuses on csh
  22. >_programming_.
  23. >
  24. >     [...list of things csh doesn't have...]
  25. >     Possibilities that could be added to csh, if anyone cared to.
  26. >     ...
  27. >     Okay, add a read statement to csh.
  28. >
  29. >Isn't this what Tom is trying to say?  Of course new features can be
  30. >added, but then the thing will cease to be csh; it'll be a nonstandard
  31. >derivative (for a while at least).  People could add history, aliases
  32. >and job control to sh, too.
  33.  
  34. ... and what's more, they have.
  35. Try bash, it's really a very nice interactive shell, *and* also
  36. a good script programming language.
  37.  
  38. >I must say that it would be nice if Bourne shell could do @ i++,
  39. >instead of $i=`expr $i + 1`.
  40.  
  41. In bash, you can do 
  42.     let i=i+1
  43. or you can even declare a particular variable as an integer, in which
  44. case all assignments are treated as 'let' statements:
  45.     declare -i counter
  46.     ...
  47.     counter=counter+1
  48. but when programming anything more than a one-off, it's usually best
  49. to stick to the portable /bin/sh functionality rather than the bash
  50. extensions. You get used to i=`expr $i + 1` pretty soon, it's probably
  51. no more difficult than getting used to i++ after Pascal's i := i + 1.
  52.  
  53. -- 
  54. Fergus Henderson             fjh@munta.cs.mu.OZ.AU      
  55. This .signature virus is a self-referential statement that is true - but 
  56. you will only be able to consistently believe it if you copy it to your own
  57. .signature file!
  58.