Ksh use (was Re: Should ``csh'' be part of ...)

Jerry Peek jerryp at cmx.npac.syr.edu
Sun Jun 5 03:21:08 AEST 1988


In article <2199 at quacky.mips.COM> dce at mips.COM (David Elliott) writes:
> 1. It's really nice to be able to say
>
>         rcsdiff -r1.{2,4} foo.c
>
>    Does ksh have anything like {}?  (In case you don't know, "-r1.{2,4}"
>    expands to "-r1.2 -r1.4".)

Back when I was using a system that had ksh, I wrote an alias called qcsh.
It passed a commandline to csh and ran it.  For instance, I'd type:

        $ qcsh rcsdiff -r1.{2,4} foo.c

To set it up, I put this alias in my .profile:

        alias qcsh=". ~/ksh/qcsh"

And this file in ~/ksh/qcsh:

--------- CUT HERE FOR qcsh FILE ----------------
#  USING "csh -fc $*" WON'T EXPAND THINGS LIKE a{b,c,d}... SO, USE TEMP FILE:
echo "$@" > /tmp/q$$
csh -f /tmp/q$$
rm -f /tmp/q$$
set --
--------- END OF qcsh FILE ---------------------

Quick and dirty, but it worked just fine.

--Jerry Peek, Northeast Parallel Architectures Center, Syracuse, NY 13244-1260
  jerryp at cmx.npac.syr.edu
  +1 315 423-4120



More information about the Comp.unix.wizards mailing list