[comp.unix.programmer] rc shell

glenn@zeus.ocs.com (Glenn Ford) (06/07/91)

Is anyone running RC shell? I am currently running Korn shell and
RC shell was commented on having syntax more "look and feel" of
'C'.  Is this true? And if so.  Do people find it as powerful 
as CSH or KSH?

glenn

haahr@adobe.com (Paul Haahr) (06/12/91)

in article <1233@ocsmd.com> glenn@zeus.ocs.com (Glenn Ford) writes:
> Is anyone running RC shell? I am currently running Korn shell and
> RC shell was commented on having syntax more "look and feel" of
> 'C'.  Is this true? And if so.  Do people find it as powerful
> as CSH or KSH?

i've been using using the implementation of rc by Byron Rakitzis for
about half a year, and would never go back to using any other shell.

the big win of rc's syntax is not its superficial resemblence to c, but
its simplicity and predicatability.  unlike most other shells,
everything is parsed once, in one pass.  this simplifies the language
enough that there is only one form of quoting (using single quotes).
the notation for backquoted commands allows easier nesting than the
multiple levels of backslashes required by sh or csh.  (i have used `{}
nested three deep in commands i've typed in off the top of my head,
with no syntax errors; i don't want to think about matching all the
necessary \\\` sequences needed for sh's rules.)

all of rc's variables are lists of strings, and this turns out to be a
very convenient data structure for a shell to use---it matches the
argc/argv interface for exec'd programs very naturally.  the strangeness
in sh that comes from using spaces or colons to separate elements of
lists disappears, and you don't have to quote variables to prevent
interpretation of metacharacters in their contents.

on the other hand, i don't use job control, command line editing, or
command completion, so it doesn't bother me that rc doesn't support
them.  (actually, if you would miss command line editing, rc can be
used with gnu readline().)

unlike csh and ksh, there are no built in math operations, but (imho)
awk, bc, and perl tend to be more appropriate than a shell for doing
math.

i'd recommend giving rc a try: just ftp it and it should compile right
out of the box.  if you do much shell programming at all, i think
you'll find it a pleasant change.  it's a small shell that does what it
does extremely well.

paul haahr, adobe systems incorporated
haahr@adobe.com		...!decwrl!adobe!haahr
paul haahr
haahr@adobe.com		...!decwrl!adobe!haahr		+1 415 962 6056