From rc-owner Thu Jan 5 15:18:51 1995 Received: from localhost by hawkwind.utcs.utoronto.ca with SMTP id <24163>; Thu, 5 Jan 1995 15:15:31 -0500 To: rc Subject: The rc mailing list is back (for good) (I hope) Date: Thu, 5 Jan 1995 15:14:57 -0500 From: Chris Siebenmann Message-Id: <95Jan5.151531est.24163@hawkwind.utcs.utoronto.ca> My apologies for the disruption; if you sent anything and it bounced (or didn't come back), you'll have to resend it (this includes address changes). The spam (and the aftermath) have been purged from the archives. I've taken this opportunity to put the latest versions on the ftp site, ftp.sys.utoronto.ca. I've also rolled over the archives as well (into a somewhat misnamed 'rc-list.1994.gz' file); in the future, I'll try to do this yearly. - cks From rc-owner Mon Jan 9 23:09:43 1995 Received: from galapagos.cse.psu.edu ([130.203.2.12]) by hawkwind.utcs.utoronto.ca with SMTP id <24158>; Mon, 9 Jan 1995 23:07:07 -0500 Received: from localhost by galapagos.cse.psu.edu with SMTP id <12686>; Mon, 9 Jan 1995 23:06:44 -0500 To: rc@hawkwind.utcs.toronto.edu Subject: rc1.5 patch Date: Mon, 9 Jan 1995 23:06:34 -0500 From: Scott Schwartz Message-Id: <95Jan9.230644est.12686@galapagos.cse.psu.edu> A while back Byron asked if I had the patch handy for a bug in the reader that someone noticed. Sorry for the delay, here's the diff. This diff also works around a bug in ObjectCenter's understanding of declarations. I know of a few other bugs, in the print library, but I think they are benign. [The fixes for those are reflected in the version of the print code that I sent to comp.sources.unix a while back, if anyone wants to integrate them. (Yeah, I ought to do it.)] diff -rc ./footobar.c /home/roke/src/rc1.5/footobar.c *** ./footobar.c Sun Mar 6 22:32:55 1994 --- /home/roke/src/rc1.5/footobar.c Tue Mar 29 23:32:56 1994 *************** *** 9,15 **** #ifdef PROTECT_ENV static bool Fconv(Format *f, int ignore) { ! unsigned const char *s = va_arg(f->args, unsigned const char *); int c; while ((c = *s++) != '\0') --- 9,15 ---- #ifdef PROTECT_ENV static bool Fconv(Format *f, int ignore) { ! const unsigned char *s = va_arg(f->args, const unsigned char *); int c; while ((c = *s++) != '\0') diff -rc ./input.c /home/roke/src/rc1.5/input.c *** ./input.c Sun Mar 6 22:33:03 1994 --- /home/roke/src/rc1.5/input.c Tue Apr 5 16:45:46 1994 *************** *** 140,145 **** --- 140,147 ---- long /*ssize_t*/ r = rc_read(istack->fd, inbuf + 2, BUFSIZE); sigchk(); if (r < 0) { + if (errno == EINTR) /*retry interrupted read*/ + continue; uerror("read"); rc_exit(1); } diff -rc ./print.c /home/roke/src/rc1.5/print.c *** ./print.c Sun Mar 6 22:33:10 1994 --- /home/roke/src/rc1.5/print.c Tue Mar 29 23:33:24 1994 *************** *** 240,246 **** */ extern int printfmt(Format *format, const char *fmt) { ! unsigned const char *s = (unsigned const char *) fmt; if (fmttab[0] == NULL) inittab(); --- 240,246 ---- */ extern int printfmt(Format *format, const char *fmt) { ! const unsigned char *s = (const unsigned char *) fmt; if (fmttab[0] == NULL) inittab(); From rc-owner Thu Mar 2 09:18:04 1995 Received: from netcom4.netcom.com ([192.100.81.107]) by hawkwind.utcs.utoronto.ca with SMTP id <24034>; Thu, 2 Mar 1995 09:17:32 -0500 Received: by netcom4.netcom.com (8.6.9/Netcom) id OAA19569; Thu, 2 Mar 1995 14:13:21 GMT Date: Thu, 2 Mar 1995 09:13:21 -0500 From: haahr@netcom.com (Paul Haahr) Message-Id: <199503021413.OAA19569@netcom4.netcom.com> To: rc@hawkwind.utcs.toronto.edu Subject: from 9fans: Bug in rc > From: Amos Shapir > To: 9fans@cse.psu.edu > Subject: Bug in rc > Date: Wed, 1 Mar 1995 08:16:34 -0500 > Message-Id: <199503011316.AA06775@hazard.cs.huji.ac.il> > > Try the following: > > #!/bin/rc > for (iter in 1 2 3 4 5) { > echo $iter > sleep 5 & > wait > } > > Somehow, the "wait" botches the "for"'s argument list. When I first read this, I was a little surprised to see that such a bug existed in so reliable a piece of code as rc. So surprised that I tried it and couldn't reproduce the problem. I was in the middle of replying when I saw that my reply was going to 9fans and not the rc list. Kudos to Byron for building a more robust clone than the original. From rc-owner Thu Mar 2 10:49:47 1995 Received: from dealer.cards.com ([192.133.70.2]) by hawkwind.utcs.utoronto.ca with SMTP id <24034>; Thu, 2 Mar 1995 10:49:06 -0500 Received: from monte (monte.cards.com) by dealer.cards.com (4.1/mls/3.2) id AA13341; Thu, 2 Mar 95 10:49:01 EST Message-Id: <9503021549.AA13341@dealer.cards.com> Received: by monte (4.1/mls/3.2) id AA00321; Thu, 2 Mar 95 10:49:00 EST Date: Thu, 2 Mar 1995 10:49:00 -0500 From: carvell@cards.com To: rc@hawkwind.utcs.toronto.edu Subject: Need help with rc on Linux Hello rc users, I'm having a strange rc problem which I believe is related to my "port" of rc to Linux. Briefly, I have a 486 box running Linux 1.1.54 with the rc-1.5betadev-1 distribution of rc. I compiled rc using the notes from Jeremy Fitzhardinge from the rc mail archives. I think I did get a few compiler warnings, but my rc has always seemed stable except for this. The problem is in an rc shell script for a simple WWW chat system. It is executed from NCSA httpd 1.3. Any time I do something along the lines of "a=`{some_command}" the script freezes. It works fine from the command line, and in a shell script executed from the command line. If I pipe some_command to a temp file, then say "a=`{cat temp}", this often works (but sometimes still freezes). I'm assuming the problem is in my port to Linux since I've used rc on my Sun4 at work for two years with no problems whatsoever, and the same shell script works fine under httpd on the Sun. When compiling for Linux I admit Any information about this problem would be greatly appreciated. In particular if you have a solid Linux version of rc, or diffs for one, or you've done any WWW stuff using rc and Linux, I'd love to hear from you. Thanks in advance folks. Gary -- Gary Carvell Galaxy Global Corporation Mail: carvell@cards.com Voice: 304-367-8249 Fax: 304-367-8223 From rc-owner Thu May 4 09:37:14 1995 Received: from archone.tamu.edu ([128.194.53.42]) by hawkwind.utcs.utoronto.ca with SMTP id <24108>; Thu, 4 May 1995 09:31:56 -0400 Received: from chops.icp.net ([199.0.55.71]) by archone.tamu.edu with SMTP id <25817>; Thu, 4 May 1995 08:34:20 -0500 Received: by chops.icp.net with SMTP id <20652>; Thu, 4 May 1995 09:31:27 -0400 From: Sean Doran Reply-To: smd@sprint.net To: rc@archone.tamu.edu Subject: rc-1.4 leaks under NetBSD 1.0 on SPARCStation 2 Date: Thu, 4 May 1995 09:31:17 -0400 Sender: smd@chops.icp.net Message-Id: <95May4.093127-0400_edt.20652+4@chops.icp.net> Well, I've tried beating it up all over the place, and am about to see if it might be a complier problem (NetBSD 1.0 uses gcc version 2.4.5). Has anyone else used rc on such a setup, and have you noticed this memory leak also? It gets quite serious; I only discovered it one day after rc had eaten up about 40Mbytes of memory... :( This is obviously operating-system dependent, as the same rc-1.4 source tree works just fine under StunOS on the same box. Any help *enormously* appreciated! Sean. - -- Script started on Thu May 4 09:22:32 1995 $ /bin/rc ; ps l$pid UID PID PPID CPU PRI NI VSZ RSS WCHAN STAT TT TIME COMMAND 32767 4950 4949 12 10 0 152 484 wait S+ pb 0:00.26 /bin/rc ; ps l$pid UID PID PPID CPU PRI NI VSZ RSS WCHAN STAT TT TIME COMMAND 32767 4950 4949 7 10 0 152 512 wait S+ pb 0:00.28 /bin/rc ; ps l$pid UID PID PPID CPU PRI NI VSZ RSS WCHAN STAT TT TIME COMMAND 32767 4950 4949 5 29 0 152 528 - R+ pb 0:00.30 /bin/rc ; echo hi there hi there ; ps l$pid UID PID PPID CPU PRI NI VSZ RSS WCHAN STAT TT TIME COMMAND 32767 4950 4949 2 10 0 152 568 wait S+ pb 0:00.32 /bin/rc ; env HOME=/u/smd LOGNAME=smd-save PATH=/usr/bin:/bin SHELL=/bin/sh TERM=xterm USER=smd-save home=/u/smd path=/usr/bin/bin prompt=;  ; ps l$pid UID PID PPID CPU PRI NI VSZ RSS WCHAN STAT TT TIME COMMAND 32767 4950 4949 1 10 0 152 620 wait S+ pb 0:00.35 /bin/rc ; whatis USER=smd-save path=(/usr/bin /bin) ifs=(' ' ' ' ' ') home=/u/smd LOGNAME=smd-save prompt=('; ' '') PATH=/usr/bin:/bin pid=4950 TERM=xterm SHELL=/bin/sh HOME=/u/smd ; Script done on Thu May 4 09:23:54 1995 From rc-owner Mon May 8 16:15:52 1995 Received: from cooper.edu ([199.98.16.4]) by hawkwind.utcs.utoronto.ca with SMTP id <24116>; Mon, 8 May 1995 16:11:48 -0400 From: micro@cooper.edu Date: Mon, 8 May 1995 16:13:55 -0400 To: rc@hawkwind.utcs.toronto.edu Subject: HTMLized Mail Archive Content-Length: 344 Message-Id: <95May8.161148edt.24116@hawkwind.utcs.utoronto.ca> Mon May 8 15:56:20 EDT 1995 Due to a need for disk space, and a lack of use of the rc mail archives, the rc HTMLized mail archive will no longer be available at : http://cooper.edu:9000/rc/ The online version will still be available via ftp at: ftp.sys.utoronto.edu in directory: /pub/rc/ Sorry for any inconvenience. R. Primus. From rc-owner Sat Jun 10 20:48:08 1995 Received: from oldp.lowell.edu ([192.103.11.90]) by hawkwind.utcs.utoronto.ca with SMTP id <24177>; Sat, 10 Jun 1995 20:46:04 -0400 Received: by oldp.lowell.edu; id AA16136; Sat, 10 Jun 1995 17:46:13 -0700 Date: Sat, 10 Jun 1995 20:46:13 -0400 From: Alan Watson Message-Id: <9506110046.AA16136@oldp.lowell.edu> To: rc@hawkwind.utcs.toronto.edu Subject: rc handler/exec problem? After months (years?) without a problem, I've come across this little weirdo in rc. It would seem that rc is having problems generating the argument list for an exec in the signal handler. I first noticed this problem while trying to exec /bin/kill -TERM $apids from a sigint handler, as I got nothing but usage and : No such file or directory errors. I've reproduced it with /bin/echo (below). This happens on Alphas running v2.0 and v3.2 OSF/1. Someone please tell me I've done something really dumb. Be charitable and blame it on working too hard. Alan ; cat sigint.rc /bin/echo foo sleep 10 & fn sigint { /bin/echo foo } sleep 10 ; rc -x sigint.rc # and hit control-c /bin/echo foo foo sleep 10 fn sigint {/bin/echo foo} sleep 10 /bin/echo foo `}: No such file or directory From rc-owner Sat Jun 10 21:45:02 1995 Received: from weaver-gw.netapp.com ([198.95.224.2]) by hawkwind.utcs.utoronto.ca with SMTP id <24178>; Sat, 10 Jun 1995 21:44:38 -0400 Received: from netapp.com ([192.9.200.1]) by weaver.netapp.com with SMTP id <15925>; Sat, 10 Jun 1995 18:44:33 +0100 Received: from lada.netapp.com by netapp.com (4.1/SMI-4.1) id AA14990; Sat, 10 Jun 95 18:45:54 PDT Received: by lada.netapp.com; (5.65/1.1.8.2/03Feb95-0320AM) id AA11538; Sat, 10 Jun 1995 18:44:47 -0700 Date: Sat, 10 Jun 1995 21:44:47 -0400 From: Byron Rakitzis Message-Id: <9506110144.AA11538@lada.netapp.com> To: alan@oldp.lowell.edu, rc@hawkwind.utcs.toronto.edu Subject: Re: rc handler/exec problem? I can reproduce this problem with 1.4 on OSF/3.0, but I can't do it with the latest "release" (1.5-betadev). Again I apologize for utterly failing to update rc from 1.4. Moving into the real world from a university was more difficult than I imagined, for many reasons. If someone wants to volunteer to take over maintenance, I can help with the transition. Otherwise you'll have to wait.. Byron. From rc-owner Tue Jul 11 14:02:48 1995 Received: from dealer.cards.com ([192.133.70.2]) by hawkwind.utcs.utoronto.ca with SMTP id <24080>; Tue, 11 Jul 1995 14:00:19 -0400 Received: from monte (monte.cards.com) by dealer.cards.com (4.1/mls/3.2) id AA02594; Tue, 11 Jul 95 14:00:08 EDT Message-Id: <9507111800.AA02594@dealer.cards.com> Received: by monte (4.1/mls/3.2) id AA00502; Tue, 11 Jul 95 14:00:08 EDT Date: Tue, 11 Jul 1995 14:00:08 -0400 From: carvell@cards.com To: rc@hawkwind.utcs.toronto.edu Subject: rc config for Solaris 2.4??? The title says it all... we are moving to Solaris 2.4 from SunOS. rc 1.5betadev compiles fine, but output from some commands is often truncated after a random number of lines. Does any kind soul out there have the right configuration for this system? Thanks in advance. Gary -- Gary Carvell Galaxy Global Corporation carvell@{cards.com, sort.ivv.nasa.gov} / 1-304-367-8249 / fax 1-304-367-8223 From rc-owner Wed Jul 12 17:02:25 1995 Received: from dealer.cards.com ([192.133.70.2]) by hawkwind.utcs.utoronto.ca with SMTP id <24080>; Wed, 12 Jul 1995 16:58:34 -0400 Received: from monte (monte.cards.com) by dealer.cards.com (4.1/mls/3.2) id AA10679; Wed, 12 Jul 95 16:58:16 EDT Message-Id: <9507122058.AA10679@dealer.cards.com> Received: by monte (4.1/mls/3.2) id AA00741; Wed, 12 Jul 95 16:58:14 EDT Date: Wed, 12 Jul 1995 16:58:14 -0400 From: carvell@cards.com To: rc@hawkwind.utcs.toronto.edu Subject: rc for Solaris 2.4? Does any kind soul out there have a working rc (or even the right config.h) for a Sun SPARC 10 running Solaris 2.4? I can't even get mine to run trip.rc all the way through no matter what configuration I try. It works ok most of the time, but for about 5-10% of the commands I enter, output is truncated after a random number of lines. Any help at all would be greatly appreciated. Gary -- Gary Carvell Galaxy Global Corporation carvell@{cards.com, sort.ivv.nasa.gov} / 1-304-367-8249 / fax 1-304-367-8223 From rc-owner Thu Jul 13 06:32:30 1995 Received: from holly.cam.harlequin.co.uk ([193.128.4.58]) by hawkwind.utcs.utoronto.ca with SMTP id <24086>; Thu, 13 Jul 1995 06:31:31 -0400 Received: from rocannon.cam.harlequin.co.uk by holly.cam.harlequin.co.uk; Thu, 13 Jul 1995 11:31:11 +0100 Received: from bessie.harlequin.co.uk (bessie.cam.harlequin.co.uk) by rocannon.cam.harlequin.co.uk; Thu, 13 Jul 1995 11:31:06 +0100 Date: Thu, 13 Jul 1995 06:29:08 -0400 Message-Id: <21827.9507131029@bessie.harlequin.co.uk> To: Gary Carvell From: Paul Haahr Reply-To: Paul Haahr Cc: rc@hawkwind.utcs.toronto.edu Subject: Re: rc for Solaris 2.4? In-Reply-To: <9507122058.AA10679@dealer.cards.com> References: <9507122058.AA10679@dealer.cards.com> Gary Carvell wrote > Does any kind soul out there have a working rc (or even > the right config.h) for a Sun SPARC 10 running Solaris > 2.4? I can't even get mine to run trip.rc all the way > through no matter what configuration I try. I compiled it with the configuration below and it seems to work and trip fine, using 1.5beta1 and compiled with gcc 2.4.5. But since I run es most of the time, I might not have noticed bugs. > It works ok most of the time, but for about 5-10% of the commands I > enter, output is truncated after a random number of lines. I haven't seen any bug like that. Seems rather odd. Output of what is truncated? The shell? Programs it runs? Paul ---- ; diff config.h-dist config.h 199a200,208 > /* > * Suggested settings for SunOS 5.4 (Solaris 2.4) > */ > > #if defined(__sun__) && defined(__svr4__) > #define PROTECT_ENV > #define SYSVR4 > #endif > ; From rc-owner Fri Jul 14 12:37:38 1995 Received: from dealer.cards.com ([192.133.70.2]) by hawkwind.utcs.utoronto.ca with SMTP id <24086>; Fri, 14 Jul 1995 12:35:19 -0400 Received: from monte (monte.cards.com) by dealer.cards.com (4.1/mls/3.2) id AA24226; Fri, 14 Jul 95 12:35:13 EDT Message-Id: <9507141635.AA24226@dealer.cards.com> Received: by monte (4.1/mls/3.2) id AA00443; Fri, 14 Jul 95 12:35:12 EDT From: carvell@cards.com Subject: Re: rc for Solaris 2.4? To: rc@hawkwind.utcs.toronto.edu Date: Fri, 14 Jul 1995 12:35:11 -0400 Content-Type: text Content-Length: 449 I would like to thank all those who responded to my question on rc for Solaris. While I haven't had any luck with the config info people have sent for rc 1.5betadev, I did receive a binary of 1.4 which does not have the command output truncation bug (thanks Eric!). If anyone needs it, I will be happy to pass it along. Gary -- Gary Carvell Galaxy Global Corporation carvell@{cards.com, sort.ivv.nasa.gov} / 1-304-367-8249 / fax 1-304-367-8223 From rc-owner Tue Jul 25 05:37:55 1995 Received: from mx0.nttdata.jp ([163.135.10.11]) by hawkwind.utcs.utoronto.ca with SMTP id <24102>; Tue, 25 Jul 1995 05:34:00 -0400 Received: from litchi.lit.rd.nttdata.jp ([163.135.200.130]) by mx0.nttdata.jp (8.6.9+2.4Wb/CF3.3Wb7-mx0-V1.10/95013022) with SMTP id SAA00364 for ; Tue, 25 Jul 1995 18:10:39 +0900 Received: from taxis.lit.rd.nttdata.jp by litchi.lit.rd.nttdata.jp (4.1/6.4J.6-LIT-3.16.95-M) id AA00874; Tue, 25 Jul 95 18:09:38 JST Received: by taxis.lit.rd.nttdata.jp (4.1/6.4J.6-LIT-3.16.95-S) id AA24499; Tue, 25 Jul 95 18:08:26 JST From: iwane@lit.rd.nttdata.jp (Kazumi Iwane) Message-Id: <9507250908.AA24499@taxis.lit.rd.nttdata.jp> Subject: rc-1.5betadev-1 sigexit problem To: rc@hawkwind.utcs.toronto.edu Date: Tue, 25 Jul 1995 05:08:26 -0400 Content-Type: text Content-Length: 1047 hello rc fans, i found a peculiar sigexit behavior of rc 1.5betadev-1 (no readline). the following script ("test") illustrates it: -------------------------------------------------------- ; cat test fn sigexit { echo sigexit $status } { echo hi | cat } > test.out ; /usr/local/bin/rc.1.5 test sigexit 0 ; cat test.out hi sigexit 0 0 ; -------------------------------------------------------- it seems that an extra sigexit is called when: command grouping is used, the last command of the group is a pair of piped processes, and the grouped commands output is redirected. this behavior is seen both on sun ss10 (sunos 4.1.3) and hp 9000/715 (hp-ux 9.05). rc-1.4 behaves as one would expect (only one sigexit at the end of the script). i fiddled with the code a little but could not come up with cure. can someone help? -- iwane@lit.rd.nttdata.jp "This is where the future lies beneath the burning sulphur skies." -- C.Hynde, 'Downtown (Akron)' From rc-owner Fri Aug 25 16:06:36 1995 Received: from oldp.nmsu.edu ([128.123.26.31]) by hawkwind.utcs.utoronto.ca with SMTP id <24124>; Fri, 25 Aug 1995 16:03:09 -0400 Received: by oldp.nmsu.edu; id AA00384; Fri, 25 Aug 1995 14:02:59 -0600 Message-Id: <9508252002.AA00384@oldp.nmsu.edu> To: rc@hawkwind.utcs.toronto.edu Subject: umask SECURITY HOLE with rc on Solaris Date: Fri, 25 Aug 1995 16:02:59 -0400 From: Alan Watson X-Mts: smtp By default in Solaris, shells inherit a umask of 0; this is Really Bad. The real fix is to change the system (edit /etc/default/login and set the umask before before starting inetd -- credit to John Denune for the latter fix) so that shells start with a umask of 022, but I still suggest applying the following patch to rc to set umask to 022 iff umask is initially 0. I know this is undeniably hand-holding, but do you really want to trust every overworked sysadmin trying to deal with the pain of Solaris to catch this one? Alan Watson *** main.c.orig Fri Aug 25 10:24:34 1995 --- main.c Fri Aug 25 10:22:09 1995 *************** *** 14,19 **** --- 14,20 ---- extern void main(int argc, char *argv[], char *envp[]) { char *dashsee[2], *dollarzero, *null[1]; int c; + int oldumask; initprint(); dashsee[0] = dashsee[1] = NULL; dollarzero = argv[0]; *************** *** 64,69 **** --- 65,75 ---- checkfd(1, rCreate); checkfd(2, rCreate); } + oldumask = umask(0); + if (oldumask == 0) + umask(022); + else + umask(oldumask); initsignal(); inithash(); initparse(); From rc-owner Wed Sep 13 07:25:49 1995 Received: from crash.Mathematik.Uni-Bielefeld.DE ([129.70.24.22]) by hawkwind.utcs.utoronto.ca with SMTP id <24144>; Wed, 13 Sep 1995 07:20:43 -0400 Received: from k4.Mathematik.Uni-Bielefeld.DE by crash.Mathematik.Uni-Bielefeld.DE id NAA27555; Wed, 13 Sep 1995 13:16:29 +0200 Received: from localhost (malte@localhost) by k4.Mathematik.Uni-Bielefeld.DE (8.6.9/8.6.9) with SMTP id NAA20266 for ; Wed, 13 Sep 1995 13:16:28 +0200 Message-Id: <199509131116.NAA20266@k4.Mathematik.Uni-Bielefeld.DE> X-Authentication-Warning: k4.Mathematik.Uni-Bielefeld.DE: malte owned process doing -bs X-Authentication-Warning: k4.Mathematik.Uni-Bielefeld.DE: Host localhost didn't use HELO protocol To: rc@hawkwind.utcs.toronto.edu Subject: rc-1.5 Date: Wed, 13 Sep 1995 07:16:27 -0400 From: Malte Uhl Hello *, pretty dead this list, eh ? To break the silence, here are two questions: It's been a long time since rc-1.5beta was released. Is there a final 1.5 release that I have missed ? I found that while $*(0) is a valid variable subscript $x(0) is not. Is there a reason for this ? Malte Uhl From rc-owner Mon Oct 16 02:35:17 1995 Received: from goggins.bath.ac.uk ([138.38.32.13]) by hawkwind.utcs.utoronto.ca with SMTP id <24189>; Mon, 16 Oct 1995 02:32:26 -0400 Received: from bath.ac.uk (actually host ss1.bath.ac.uk) by goggins.bath.ac.uk with SMTP (PP); Sun, 15 Oct 1995 19:16:00 +0100 To: wilyfans@jli.com, rc@hawkwind.utcs.toronto.edu Subject: editline, rc & win Reply-To: I.Sparry@bath.ac.uk Date: Sun, 15 Oct 1995 14:15:54 -0400 From: Icarus Sparry Message-ID: <9510151915.aa16726@ss1.bath.ac.uk> Here is a very lightly tested patch for editline so that if it doesn't think that it is talking to a terminal (i.e. isatty(0) is false) then it does not do any editing, and does not echo. I wanted a single binary for 'rc' that I could use (with editing) from a vt100 terminal and also use with 'wily' and 'win'. I repeat that it is very lightly tested - use at own risk. Icarus --- ../editline.orig/editline.c Sun Oct 15 17:05:14 1995 +++ editline.c Sun Oct 15 18:51:25 1995 @@ -84,6 +84,7 @@ STATIC int PushBack; STATIC int Pushed; STATIC int Signal; +FORWARD KEYMAP TinyMap[3]; /* Should be 2 */ FORWARD KEYMAP Map[33]; FORWARD KEYMAP MetaMap[17]; STATIC SIZE_T Length; @@ -92,6 +93,7 @@ STATIC char *backspace; STATIC int TTYwidth; STATIC int TTYrows; +STATIC int DoOwnEcho; /* Display print 8-bit chars as `M-x' or as the actual 8-bit char? */ int rl_meta_chars = 1; @@ -116,10 +118,10 @@ STATIC void TTYflush() { - if (ScreenCount) { + if (ScreenCount && DoOwnEcho) { (void)write(1, Screen, ScreenCount); - ScreenCount = 0; } + ScreenCount = 0; } STATIC void @@ -142,6 +144,17 @@ } STATIC void +TTYputsa(p) + STRING p; +{ + int l; + if (!DoOwnEcho) { + l = strlen(p); + write(1,p,l); + } else TTYputs(p); +} + +STATIC void TTYshow(c) CHAR c; { @@ -222,6 +235,8 @@ } init++; + DoOwnEcho = isatty(0); + TTYwidth = TTYrows = 0; #if defined(USE_TERMCAP) bp = &buff[0]; @@ -870,7 +885,7 @@ PushBack = UNMETA(c); return meta(); } - for (kp = Map; kp->Function; kp++) + for (kp = (DoOwnEcho?Map:TinyMap); kp->Function; kp++) if (kp->Key == c) break; s = kp->Function ? (*kp->Function)() : insert_char((int)c); @@ -884,9 +899,9 @@ TTYspecial(c) unsigned int c; { + if (!DoOwnEcho) return CSdispatch; if (ISMETA(c)) return CSdispatch; - if (c == rl_erase || c == DEL) return bk_del_char(); if (c == rl_kill) { @@ -1013,7 +1028,7 @@ ScreenSize = SCREEN_INC; Screen = NEW(char, ScreenSize); Prompt = prompt ? prompt : (char *)NIL; - TTYputs((STRING)Prompt); + TTYputsa((STRING)Prompt); if ((line = editinput()) != NULL) { line = (CHAR *)strdup((char *)line); TTYputs((STRING)NEWLINE); @@ -1402,6 +1417,11 @@ { CTL(']'), move_to_char }, { CTL('^'), ring_bell }, { CTL('_'), ring_bell }, + { 0, NULL } +}; + +STATIC KEYMAP TinyMap[3] = { + { CTL('J'), accept_line }, { 0, NULL } }; From rc-owner Mon Oct 16 08:40:47 1995 Received: from postman.osf.org ([130.105.1.152]) by hawkwind.utcs.utoronto.ca with SMTP id <24189>; Mon, 16 Oct 1995 08:39:59 -0400 Received: from sulphur.osf.org (sulphur.osf.org [130.105.1.123]) by postman.osf.org (8.6.9/8.6.x) with SMTP id IAA25175; Mon, 16 Oct 1995 08:39:56 -0400 From: Rich Salz Received: by sulphur.osf.org (1.38.193.4/4.7) id AA09336; Mon, 16 Oct 1995 08:37:55 -0400 Date: Mon, 16 Oct 1995 08:37:55 -0400 Message-Id: <9510161237.AA09336@sulphur.osf.org> To: I.Sparry@bath.ac.uk, wilyfans@jli.com, rc@hawkwind.utcs.toronto.edu Subject: Re: editline, rc & win That's a lot of icky little code scattered throughout. You want no editing, no echo if not a tty? I don't understand the problem space. editline being called to read a pipe? From rc-owner Thu Nov 2 23:46:27 1995 Received: from cortex.physiol.su.oz.au ([129.78.131.10]) by hawkwind.utcs.utoronto.ca with SMTP id <24056>; Thu, 2 Nov 1995 23:41:04 -0500 Received: (john@localhost) by cortex.physiol.su.oz.au (8.6.11/8.6.4) id PAA19841 for rc@hawkwind.utcs.toronto.edu; Fri, 3 Nov 1995 15:40:41 +1100 From: John (Watching the Wheels) Mackin Date: Thu, 2 Nov 1995 23:30:40 -0500 To: rc@hawkwind.utcs.toronto.edu Subject: Clean design pays dividends -- and stupid kludges don't Message-ID: <199511031530.18948.software.babaz@physiol.su.oz.au> X-Face: 39seV7n\`#asqOFdx#oj/Uz*lseO_1n9n7rQS;~ve\e`&Z},nU1+>0X^>mg&M.^X$[ez>{F k5[Ah<7xBWF-@-ru?& @4K4-b`ydd^`(n%Z{ Hi. Those of you who have been on this list for a while may remember me -- fond greetings to all old-timers! I haven't resubscribed (I can't at this stage) but I have come across something in recent months that I have decided cries out to be mentioned here. You see, I now have a computer at home -- something I resisted through all the many years of my professional life (with computers). But now that I am no longer working, I really need something at home to do writing on, and keep track of my (paper) files, and like that. Of course the fact that I am no longer working also means that I have nothing to spend on such a computer, so I am (still, after two years) building one out of parts I can scavenge. That one, when finished, will be big enough to run FreeBSD so I will be able to use rc as my shell as always, and there will be no problem. But it is taking so long to build that I really needed a stopgap, and I had enough hardware to build a stopgap machine. The thing is that it (on which I am indeed typing this mail! -- I will sneakernet it in to University later in order to send it) is only a 286, so it can't run any reasonable kind of Unix. So I'm stuck with MS-DOS -- and therefore I cannot use rc (as far as I know! -- I'd be _delighted_ as well as astonished to hear that someone has done a DOS port). But I do at least have the some command binaries that make the thing look enough like Unix most of the time that I am much more comfortable than I would be with raw DOS. Now we are getting to the point of this posting: the shell I have is a port of ksh. I never used ksh on Unix but was basically familiar with its offerings. Now, I use it all the time, and of course I do not like it. But the worst thing is its history. Not only does it not (seem to, perhaps I just can't figure out how) offer any way to preserve your history effectively from one login session to the next -- something I always do with my rc history files on Unix, and which I like very much; and of course with a true external history file, it's your option -- but worse still, it has stupid "features" that interact badly (read: don't interact at all). Consider this real example: I've been writing a letter to someone. I think I have finished: $ spell theletter ... The spell output looks all right. I'll print it now: $ lpr $_ For those list-readers who are lucky enough to not know, this is a ksh idiom. $_ is set to the last argument of the previous command. It's a handy kludge, since a lot of the time in Unix the last argument is the file you're currently doing something or other to, as in this case. All right, it's printing now. Gee, I wonder what time it is? $ date ... Oh, not too late. I'd better print another copy of the letter to go into the filing cabinet, so I use the built-in ksh history, expecting to re-execute the command I did a moment ago: it's (in this case) vi-like, so I type , then "k" once -- and see $ date then "k" again, and see: $ lpr $_ and then I think "Bugger! If I type now to execute this, I know damn well what I would get -- yes, you guessed it, I'd get `lpr date'." (let ((sarcastic #t)) Wonderful, wonderful work, guys. Well-designed, clean interface. ) I will be very happy indeed when I can give ksh the big flick, and go back full-time to my best friend in shells, rc. OK, John. From rc-owner Mon Feb 5 20:32:54 1996 Received: from localhost by hawkwind.utcs.utoronto.ca with SMTP id <23984>; Mon, 5 Feb 1996 20:28:49 -0500 To: rc Subject: A mismatch between Byron's rc and Plan 9 rc: Date: Mon, 5 Feb 1996 20:28:33 -0500 From: Chris Siebenmann Message-Id: <96Feb5.202849est.23984@hawkwind.utcs.utoronto.ca> From: td@plan9.att.com To: 9fans@cse.psu.edu Date: Mon, 5 Feb 1996 13:11:58 -0500 Subject: re: rc syntax bug Stephen Hemminger thinks there's a bug: >Isn't it surprising: > if (! ~ () ()) echo 'i am a bug' I'm sorry, what do you think the bug is? The syntax is obviously ok, and the result is exactly what I intended. A match against an empty list always fails, the definition being that at least one alternative must succeed for the match to succeed. From rc-owner Wed Feb 7 13:09:12 1996 Received: from weaver-gw.netapp.com ([198.95.224.2]) by hawkwind.utcs.utoronto.ca with SMTP id <23986>; Wed, 7 Feb 1996 13:05:18 -0500 Received: from netapp.com ([192.9.200.1]) by weaver.netapp.com with SMTP id <15859-119>; Wed, 7 Feb 1996 10:06:01 -0000 Received: from nova.netapp.com by netapp.com (4.1/SMI-4.1) id AA20456; Wed, 7 Feb 96 10:05:23 PST Received: by nova.netapp.com (4.1/SMI-4.1) id AA01521; Wed, 7 Feb 96 10:05:22 PST Date: Wed, 7 Feb 1996 13:05:22 -0500 From: byron@netapp.com (Byron Rakitzis) Message-Id: <9602071805.AA01521@nova.netapp.com> To: rc@hawkwind.utcs.toronto.edu Subject: I just thought of a cool hack I wanted to use the history command to edit the output of make, in particular to change -g to -S to examine asm output. So I did: ; make -n quick.o >> $history ; -- gcc and edited the command with the history command. Having history outside of the shell has been very useful to me over the years. From rc-owner Wed Feb 7 14:46:04 1996 Received: from emory.mathcs.emory.edu ([128.140.2.1]) by hawkwind.utcs.utoronto.ca with SMTP id <23987>; Wed, 7 Feb 1996 14:44:38 -0500 Received: from skeeve.UUCP by emory.mathcs.emory.edu (5.65/Emory_mathcs.4.0.17) via UUCP id AA20488 ; Wed, 7 Feb 96 14:44:21 -0500 Return-Path: arnold@skeeve.atl.ga.us Received: by skeeve.atl.ga.us (/\==/\ Smail3.1.22.1 #22.1) id ; Wed, 7 Feb 96 14:27 EST Message-Id: Date: Wed, 7 Feb 1996 14:27:00 -0500 From: arnold@skeeve.atl.ga.us (Arnold D. Robbins) To: byron@netapp.com, rc@hawkwind.utcs.toronto.edu Subject: Re: I just thought of a cool hack Byron said: > I wanted to use the history command to edit the output of make, in particular > to change -g to -S to examine asm output. So I did: > > ; make -n quick.o >> $history > ; -- gcc > > and edited the command with the history command. > > Having history outside of the shell has been very useful to me over the > years. I usually do something like make -n foo | sed 's/-g/-S/' | sh -x Or I just do the `make | sed' and snarf and barf it back with 9term... Arnold From rc-owner Mon Mar 18 00:28:58 1996 Received: from chardos.connix.com ([205.246.97.17]) by hawkwind.utcs.utoronto.ca with SMTP id <24313>; Mon, 18 Mar 1996 00:28:21 -0500 Received: (from saken@localhost) by chardos.connix.com (8.7.4/8.7.3) id AAA00380 for rc@hawkwind.utcs.toronto.edu; Mon, 18 Mar 1996 00:26:55 -0500 (EST) Message-Id: <199603180526.AAA00380@chardos.connix.com> Subject: FreeBSD & limit To: rc@hawkwind.utcs.toronto.edu (rc mailinglist) Date: Mon, 18 Mar 1996 00:26:54 -0500 From: "Scott Kenney" X-OS: FreeBSD 2.1-RELEASE X-Tori-Quote: ...threads of gold aren't easily broken. X-Mailer: ELM [version 2.4 PL25 ME8b] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Has anyone gotten the limit code to function correctly under FreeBSD? -- Scott Kenney >|< saken@chardos.connix.com From rc-owner Sun Mar 24 19:35:44 1996 Received: from abyss.viasub.net ([206.40.193.2]) by hawkwind.utcs.utoronto.ca with SMTP id <24322>; Sun, 24 Mar 1996 19:34:04 -0500 Received: from justin-s (viasub-ppp08.viasub.net [206.40.193.27]) by abyss.viasub.net (8.6.8.1/SCA-6.6) with SMTP id AAA23344 for ; Mon, 25 Mar 1996 00:35:41 GMT Return-Path: Message-Id: <199603250035.AAA23344@abyss.viasub.net> Date: Sun, 24 Mar 1996 19:26:13 -0500 From: Kimm Edstrom X-Mailer: Mozilla 1.22 (Windows; U; 32bit) MIME-Version: 1.0 To: rc@hawkwind.utcs.toronto.edu Subject: Fast Money Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Subject: NEED FAST CASH? HERE IT IS! Hello! I've got some awesome news that I think you need to take two minutes to read if you have ever thought "How could I make some serious cash in a hurry???" , or been in serious debt, ready to do almost anything to get the money needed to pay off those bill collectors. So grab a snack, a warm cup of coffee, or a glass of your favorite beverage, get comfortable and listen to this interesting, exciting find! Let me start by saying that I FINALLY FOUND IT! That's right! I found it! And I HATE GET RICH QUICK SCHEMES!! I hate those schemes like multi-level marketing, mail-order schemes, envelope stuffing scams, 900 number scams... the list goes on forever. I have tried every darn get rich quick scheme out there over the past 12 years. I somehow got on mailing lists for people looking to make money (more like 'desperate stupid people who will try anything for money!'). Well, when I was a teenager, these claims to 'get me rich quick' sounded irresistible! I would shell out $14.95 here, $29.95 there, $24.95 here, and another $49.95 there. I had maxed out my new Circuit City Card AND my Visa...I was desperate for money!! So, I gave them all a chance but failed at every one of them! Maybe they worked for some people, but not for me. Eventually, I just tossed that JUNK MAIL in the trash when I got the mail. I recognized it right away. I can smell a money scam from a mile away these days, SO I THOUGHT.... I thought I could sniff out a scam easily. WAS I WRONG!! ....I LOVE THE INTERNET!!! I was scanning thru a NEWSGROUP and saw an article stating to GET CASH FAST!! I thought..."Here on the Internet?? Well, I'll just have to see what schemes could possibly be on the internet." The article described a way to MAIL A ONE DOLLAR BILL TO ONLY FIVE PEOPLE AND MAKE $50, 0000 IN CASH WITHIN 4 WEEKS! Well, the more I thought about it, the more I became very curious. Why? Because of the way it worked AND BECAUSE IT WOULD ONLY COST ME FIVE DOLLARS (AND FIVE STAMPS), THAT'S ALL I EVER PAY....EVER!! Ok, so the $50,000 in cash was maybe an tough amount to reach, but it was possible. I knew that I could at least get a return of $1,000 or so. So I did it!! As per the instructions in the article, I mailed out ('snail mail' for you e-mail fanatics) a single dollar bill to each of the five people on the list that was contained in the article. I included a small note, with the dollar, that stated "Please Add Me To Your List." I then removed the first position name of the five names listed and moved everyone up one position, and I put my name in position five of the list. This is how the money starts rolling in! I then took this revised article now with my name on the list and REPOSTED IT ON AS MANY NEWSGROUPS AND LOCAL BULLETIN BOARD MESSAGE AREAS THAT I KNEW. I then waited to watch the money come in...prepared to maybe receive about $1000 to $1500 in cash or so.... But what a welcome surprise when those envelopes kept coming in!!! I knew what they were as soon as I saw the return addresses from people all over the world -Most from the U.S., but some from Canada, even some from Australia! I tell you, THAT WAS EXCITING!! So how much did I get in total return? $1000? $5000? Not even!!! I received a total of $23,343!!! I couldn't believe it!! I now have a brand new black Acura Integra to speak for, due to this!! Now after almost 8 months, I am ready to do it again!!! So maybe it was possible to get $50,000 in cash, I don't know, but IT COMPLETELY DEPENDS ON YOU, THE INDIVIDUAL! You must follow through and repost this article everywhere you can think of! The more postings you achieve will determine how much cash will arrive in your very own mailbox!! It's just too easy to pass up!!! Let's review the reasons why you should do this: The only cost factors are for the five stamps, the 5 envelopes and the 5 one dollar bills that you send out to the listed names by snail mail (US Postal Service Mail). Then just simply repost the article (WITH YOUR NAME ADDED) to all the newsgroups and local BBS's you can. Then sit back and, (ironically), enjoy walking (you can run if you like! :o ) down your driveway to your mailbox and scoop up your rewards!! We all have five dollars to put into such an easy effortless investment with SPECTACULAR REALISTIC RETURNS OF $15,000 to $25,000 in about 3-5 weeks! So HOLD OFF ON THOSE LOTTERY NUMBERS FOR TODAY, EAT AT HOME TONIGHT INSTEAD OF TAKEOUT FROM McDONALDS AND INVEST FIVE DOLLARS IN THIS AMAZING MONEY MAKING SYSTEM NOW!!! YOU CAN'T LOSE!! So how do you do it exactly, you ask? I have carefully provided the most detailed, yet straightforward instructions on how to easily get this underway and get your cash on its way. SO, ARE YOU READY TO MAKE SOME CASH!!!?? HERE WE GO!!! *** THE LIST OF NAMES IS AT THE END OF THIS ARTICLE. *** OK, Read this carefully. Get a printout of this information, if you like, so you can easily refer to it as often as needed. INSTRUCTIONS: 1. Take a sheet of paper and write on it the following: "Please add my name to your list". This creates a service out of this money making system and thus making it completely legal. You are not just randomly sending a dollar to someone, you are paying one dollar for a legitimate service. Make sure you include your name and address. I assure you that, again, this is completely legal! For a neat little twist, also write what slot their name was in: "You were in slot 3", Just to add a little fun! This is all about having fun and making money at the same time! 2. Now fold this sheet of paper around a dollar bill ,(no checks or money orders), and put them into an envelope and send it on its way to the five people listed. The folding of the paper around the bill will insure its arrival to its recipient. THIS STEP IS IMPORTANT!! 3. Now listen carefully, here's where you get YOUR MONEY COMING TO YOUR MAILBOX. Look at the list of five people; remove the first name from position one and move everyone on the list up slot one on the list. Position 2 name will now move to the position 1 slot , position 3 will now become position 2, 4 will be 3, 5 will be 4. Now put your name, address, zipcode AND COUNTRY in position 5, the bottom position on the list. 4. Now upload this updated file to as many newsgroups and local bulletin boards' message areas & file section as possible. Give a catchy description of the file so it gets noticed!! Such as: "NEED FAST CASH?, HERE IT IS!" or "NEED CASH TO PAY OFF YOUR DEBTS??", etc. And the more uploads, the more money you will make, and of course, the more money the others on the list will make too. LET'S ALL TAKE CARE OF EACH OTHER BY BEING HONEST AND BY PUTTING FORTH 120 PERCENT INTO THIS PROFITABLE & AMAZING SYSTEM!!! You'll reap the benefits, believe me!!! Set a goal for the number of total uploads you'll post, such as 15-20 postings or more! Always have a goal in mind!!! If you can UUE encode the file when uploading, that will make it easier for the people to receive it and have it downloaded to their hard drive. That way they get a copy of the article right on their computer without hassles of viewing and then saving the article from the File menu. Don't alter the file type, leave it as an MS-DOS Text file. The best test is to be able to view this file using Microsoft's Notepad for Windows 3.x or WordPad for Windows '95. If the margins look right without making the screen slide left or right when at the ends of the sentences, you're in business! 5. If you need help uploading, simply ask the sysop of the BBS, or "POST" a message on a newsgroup asking how to post a file, tell them who your Internet provider is and PEOPLE WILL ALWAYS BE GLAD TO HELP. I would try to describe how to do it but there are simply too many internet software packages with slightly different yet relatively simple ways to post or upload a file. Just ask for help or look in the help section for 'posting'. I do know that for GNN, you simply select 'POST' then enter a catchy description under the subject box, choose 'ATTACH', selecting 'UUE' and NOT 'TXT', then choose 'Browse' to go look for the file. Find your text file CASH.TXT and click on it and choose 'OK'. Place a one line statement in the main body section of the message post screen. Something like "Download this to read how to get cash arriving in your mailbox with no paybacks!" or whatever. Just make sure it represents its true feasibility, NOT something like..."Get one million dollars flooding in your mailbox in two days!" You'll never get ANY responses! 6. And this is the step I like. JUST SIT BACK AND ENJOY LIFE BECAUSE CASH IS ON ITS THE WAY!! Expect to see a little money start to trickle in around 2 weeks, but AT ABOUT WEEKS 3 & 4, THE MONEY STORM WILL HIT YOUR MAILBOX!! All you have to do is take it out of the mailbox and try not to scream too loud (outside anyway) when you realize YOU HIT THE BIG TIME AT LAST!! 7. So go PAY OFF YOUR BILLS AND DEBTS and then get that something special you always wanted or buy that special person in your life (or the one you want in your life) a gift they'll never forget. ENJOY LIFE! 8. Now when you get low on this money supply, simply re-activate this file again; Reposting it in the old places where you originally posted and possibly some new places you now know of. Don't ever lose this file, always keep a copy at your reach for when you ever need cash. THIS IS AN INCREDIBLE TOOL THAT YOU CAN ALWAYS RE-USE TIME AND TIME AGAIN WHEN CASH IS NEEDED! 9. (This step added by Charles Reiley). Hello, This is exciting isn't it?! While I'm on the list, just add a note saying "Please include extra money tips" with your name & E-MAIL address, and I will (FOR FREE) send you some neat methods to increase the money you will receive with this plan. Why?... Why not? I'm not a selfish jerk...I like helping out others. E-mail just makes it a touch easier and cheaper, too! After I drop off the list, I can no longer offer you this advice, obviously, but maybe someone else who gets my tips will offer and simply replace my name on this step number 9. Good luck and give this plan your all, it will definitely pay off! Like Mike said, HAVE FUN WITH IT!!! *NOTE- I will pick up where Charles left off while I'm on the list. That way, maybe some people will actually send me the $1 (g). -Jon Heifetz* ************************************************************ *************** ************************************************************ *************** THE NAMES LIST THE NAMES LIST THE NAMES LIST ************************************************************ *************** HONESTY IS WHAT MAKES THIS PROGRAM SUCCESSFUL!!! 1. Paul Dittrich 1509 Trigg Lane Wichita Falls, TX 76306 2. George Juniel 5000 Western Ave. #2100 Knoxville. TN 37921 USA 3. Jon Heifetz 21 Raemont Rd. Granite Springs, NY 10527. 4. Justin Crandall 2098 Rosemary ct. Hemet, CA 92545 USA 5. Kimm Edstrom 7560 Orchard St. Apt #74 Riverside, CA 92504 USA ************************************************************ *************** NOTE: Try to keep a list of everyone that sends you a dollar and always keep an eye on the local postings of this file...Just to make sure that everyone is playing the game fairly. You know where your name should be..... *** AGAIN, HONESTY IS THE BEST THING WE HAVE GOING FOR US ON THIS PLAN. From rc-owner Mon Jun 24 15:19:21 1996 Received: from localhost by hawkwind.utcs.utoronto.ca with SMTP id <24391>; Mon, 24 Jun 1996 15:07:05 -0400 To: es, rc, sam-fans Subject: Status of the es/rc/sam-fans mailing lists Date: Mon, 24 Jun 1996 15:06:21 -0400 From: Chris Siebenmann Message-Id: <96Jun24.150705edt.24391@hawkwind.utcs.utoronto.ca> They're back (as you can see). I've resurrected all the messages for them from the time they were down. Unfortunately, they are still not being run under a mailing list manager, so there's no restriction on who can send messages; fortunately spam sent to them appears to have died down (AOL apparently obtained a fairly strong injuction against the major spammer). They will be converted to subscribers-only posting at some point in the future; I just thought it would be better to have them existing in the mean time. - cks From rc-owner Fri Nov 1 11:21:20 1996 Received: from blah.math.tu-graz.ac.at ([129.27.150.3]) by hawkwind.utcs.utoronto.ca with SMTP id <24529>; Fri, 1 Nov 1996 11:16:49 -0500 Received: from blah.math.tu-graz.ac.at by blah.math.tu-graz.ac.at (8.7.2/8.7.2) with ESMTP id QAA29780 for ; Fri, 1 Nov 1996 16:32:17 +0100 Message-Id: <199611011532.QAA29780@blah.math.tu-graz.ac.at> To: rc@hawkwind.utcs.toronto.edu Subject: rc on MkLinux (or anything with a ppc and gcc) X-Mailer: Bri's Magic Mailer (v 342.4plokta) Date: Fri, 1 Nov 1996 10:32:16 -0500 From: Brian Ward I have a couple of hints for anyone wanting to use rc on this config. First and foremost, don't use the libc that comes with the DR2, get the newest from the Updates/libs directory. Among other things, readdir() was broken in the old one. Second, they did something strange with va_list for the PowerPC gcc compiler- made it into a one-element array for some reason which I'd rather not know. So, to get past that (print.c doesn't compile), use a stupid hack like the one in the patch I'm appending to the end of this message. Third, use /usr/src/asm/signal.h for sigmsgs.c, as usual with Linux. Anyway, as usual, thanks to Byron and everyone else who's done work on the port, it's really a better life when you don't have to use something which I'd prefer not to think of for a shell. Really. 276,277c276,277 < saveargs = format->args; < format->args = ap; --- > saveargs[0] = format->args[0]; > format->args[0] = ap[0]; 280c280 < format->args = saveargs; --- > format->args[0] = saveargs[0]; 307c307 < format.args = ap; --- > format.args[0] = ap[0]; 351c351 < format.args = ap; --- > format.args[0] = ap[0]; 364c364 < format.args = ap; --- > format.args[0] = ap[0]; From rc-owner Fri Dec 6 11:37:48 1996 Received: from pertsserver.cs.uiuc.edu ([128.174.247.69]) by hawkwind.utcs.utoronto.ca with SMTP id <24578>; Fri, 6 Dec 1996 11:32:07 -0500 Received: (from mkgardne@localhost) by pertsserver.cs.uiuc.edu (8.8.3/8.8.3) id KAA14045; Fri, 6 Dec 1996 10:32:04 -0600 (CST) Date: Fri, 6 Dec 1996 11:32:04 -0500 Message-Id: <199612061632.KAA14045@pertsserver.cs.uiuc.edu> From: "Mark K. Gardner" To: rc@hawkwind.utcs.toronto.edu Subject: RC and GDB Blues Reply-to: mkgardne@cs.uiuc.edu Hello all, I am having trouble running gdb with rc 1.5betadev on Solaris 2.5.1 either from the command line or from within emacs. When I run from tcsh, gdb works fine. I am at a loss for where to start looking for the problem. Hints anyone? -- Mark (mkgardne@cs.uiuc.edu) -- ; gdb main GDB is free software and you are welcome to distribute copies of it under certain conditions; type "show copying" to see the conditions. There is absolutely no warranty for GDB; type "show warranty" for details. GDB 4.16 (sparc-sun-solaris2.5), Copyright 1996 Free Software Foundation, Inc... (gdb) set args <../input (gdb) run Starting program: main <../input Program received signal SIGTRAP, Trace/breakpoint trap. Cannot remove breakpoints because program is no longer writable. It might be running in another process. Further execution is probably impossible. 0xef7d725c in ?? () (gdb) quit The program is running. Quit anyway (and kill it)? (y or n) y From rc-owner Fri Dec 6 11:43:24 1996 Received: from galapagos.cse.psu.edu ([130.203.2.12]) by hawkwind.utcs.utoronto.ca with SMTP id <24579>; Fri, 6 Dec 1996 11:43:08 -0500 Received: from localhost by galapagos.cse.psu.edu with SMTP id <12685>; Fri, 6 Dec 1996 11:42:28 -0500 To: rc@hawkwind.utcs.toronto.edu Subject: Re: RC and GDB Blues In-reply-to: Your message of "Fri, 06 Dec 1996 11:32:04 EST." <199612061632.KAA14045@pertsserver.cs.uiuc.edu> Date: Fri, 6 Dec 1996 11:42:13 -0500 From: Scott Schwartz Message-Id: <96Dec6.114228est.12685@galapagos.cse.psu.edu> I've run it on Solaris 2.5.1, and didn't see tha tproblem. But speaking of 1.5betadev, anyone think the glob routines should (via a run time switch) work on utf-8? Then 9term and sam users can fully break with 8859-1. From rc-owner Fri Dec 6 12:32:26 1996 Received: from netcom12.netcom.com ([192.100.81.124]) by hawkwind.utcs.utoronto.ca with SMTP id <24580>; Fri, 6 Dec 1996 12:32:01 -0500 Received: (from haahr@localhost) by netcom12.netcom.com (8.6.13/Netcom) id JAA09500; Fri, 6 Dec 1996 09:29:39 -0800 Date: Fri, 6 Dec 1996 12:29:39 -0500 From: haahr@netcom.com (Paul Haahr) Message-Id: <199612061729.JAA09500@netcom12.netcom.com> To: "Mark K. Gardner" Cc: rc@hawkwind.utcs.toronto.edu Subject: Re: RC and GDB Blues In-Reply-To: <199612061632.KAA14045@pertsserver.cs.uiuc.edu> References: <199612061632.KAA14045@pertsserver.cs.uiuc.edu> > I am having trouble running gdb with rc 1.5betadev on Solaris 2.5.1 > either from the command line or from within emacs. When I run from > tcsh, gdb works fine. I am at a loss for where to start looking for > the problem. Hints anyone? Did you compile with -lbsd? From rc-owner Fri Dec 6 12:42:15 1996 Received: from netcom12.netcom.com ([192.100.81.124]) by hawkwind.utcs.utoronto.ca with SMTP id <24581>; Fri, 6 Dec 1996 12:41:56 -0500 Received: (from haahr@localhost) by netcom12.netcom.com (8.6.13/Netcom) id JAA10041; Fri, 6 Dec 1996 09:32:09 -0800 Date: Fri, 6 Dec 1996 12:32:09 -0500 From: haahr@netcom.com (Paul Haahr) Message-Id: <199612061732.JAA10041@netcom12.netcom.com> To: Scott Schwartz Cc: rc@hawkwind.utcs.toronto.edu Subject: Re: RC and GDB Blues In-Reply-To: <96Dec6.114228est.12685@galapagos.cse.psu.edu> References: <199612061632.KAA14045@pertsserver.cs.uiuc.edu> <96Dec6.114228est.12685@galapagos.cse.psu.edu> > But speaking of 1.5betadev, anyone think the glob routines should (via > a run time switch) work on utf-8? Then 9term and sam users can fully > break with 8859-1. What's needed to make the shell utf8-savvy? I supposed it's just ? and [chars] that don't work right, right? From rc-owner Fri Dec 6 13:20:44 1996 Received: from galapagos.cse.psu.edu ([130.203.2.12]) by hawkwind.utcs.utoronto.ca with SMTP id <24578>; Fri, 6 Dec 1996 13:20:16 -0500 Received: from localhost by galapagos.cse.psu.edu with SMTP id <12685>; Fri, 6 Dec 1996 13:19:33 -0500 To: haahr@netcom.com (Paul Haahr) cc: rc@hawkwind.utcs.toronto.edu Subject: Re: RC and GDB Blues In-reply-to: Your message of "Fri, 06 Dec 1996 12:32:09 EST." <199612061732.JAA10041@netcom12.netcom.com> Date: Fri, 6 Dec 1996 13:19:27 -0500 From: Scott Schwartz Message-Id: <96Dec6.131933est.12685@galapagos.cse.psu.edu> haahr@netcom.com (Paul Haahr) writes: | What's needed to make the shell utf8-savvy? I supposed it's just ? and | [chars] that don't work right, right? Yes. From rc-owner Fri Dec 6 15:19:25 1996 Received: from pertsserver.cs.uiuc.edu ([128.174.247.69]) by hawkwind.utcs.utoronto.ca with SMTP id <24578>; Fri, 6 Dec 1996 15:18:52 -0500 Received: (from mkgardne@localhost) by pertsserver.cs.uiuc.edu (8.8.3/8.8.3) id OAA15059; Fri, 6 Dec 1996 14:18:36 -0600 (CST) Date: Fri, 6 Dec 1996 15:18:36 -0500 Message-Id: <199612062018.OAA15059@pertsserver.cs.uiuc.edu> From: "Mark K. Gardner" To: schwartz@galapagos.cse.psu.edu CC: rc@hawkwind.utcs.toronto.edu In-reply-to: <96Dec6.114228est.12685@galapagos.cse.psu.edu> (message from Scott Schwartz on Fri, 6 Dec 1996 11:42:13 -0500) Subject: Re: RC and GDB Blues Reply-to: mkgardne@cs.uiuc.edu >>>>> "Scott" == Scott Schwartz writes: > I've run it on Solaris 2.5.1, and didn't see tha tproblem. I have discovered the problem. rc is not installed in /etc/shells and hence I cannot have it as my login shell in /etc/passwd (tcsh is). I instead "exec rc -l" from .tcshrc. GDB executes a program under the shell specified by the SHELL variable (i.e., which was tcsh in my case), which causes .tcshrc to be read, which causes "exec rc -l", which causes a SIGTRAP. Adding "SHELL=" to .rcrc cured the problem. -- Mark (mkgardne@cs.uiuc.edu) -- From rc-owner Fri Dec 6 15:50:50 1996 Received: from perts6.cs.uiuc.edu ([128.174.247.68]) by hawkwind.utcs.utoronto.ca with SMTP id <24578>; Fri, 6 Dec 1996 15:50:03 -0500 Received: (from mkgardne@localhost) by perts6.cs.uiuc.edu (8.8.3/8.8.3) id OAA09530; Fri, 6 Dec 1996 14:50:00 -0600 (CST) Date: Fri, 6 Dec 1996 15:50:00 -0500 Message-Id: <199612062050.OAA09530@perts6.cs.uiuc.edu> From: "Mark K. Gardner" To: rc@hawkwind.utcs.toronto.edu Subject: rsh and rc Reply-to: mkgardne@cs.uiuc.edu Has anyone managed to get rsh to work when rc is the shell at both ends? rc is running (I can tell because of an echo command in .rcrc), but my command doesn't get run (either that or stdout is not being sent back). ; rsh -n perts0 uptime In .rcrc! <- due to echo in .rcrc [Setup: I am exec'ing rc from .tcshrc, since our sysadmin has yet to add rc to /etc/shells. When I use tcsh instead of rc, rsh works fine. The bin and home directories are identical (i.e., shared). We are running Solaris v2.5.1.] Thanks. -- Mark (mkgardne@cs.uiuc.edu) -- Up and coming fan of the rc shell. -- From rc-owner Fri Dec 6 16:09:02 1996 Received: from oldp.nmsu.edu ([128.123.26.31]) by hawkwind.utcs.utoronto.ca with SMTP id <24578>; Fri, 6 Dec 1996 16:08:34 -0500 Received: by oldp.nmsu.edu; id AA23719; Fri, 6 Dec 1996 14:07:46 -0700 Date: Fri, 6 Dec 1996 16:07:46 -0500 From: Alan Watson Message-Id: <9612062107.AA23719@oldp.nmsu.edu> To: mkgardne@cs.uiuc.edu, rc@hawkwind.utcs.toronto.edu Subject: Re: rsh and rc Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit I'd hazard a guess that when you exec you throw away the arguments to the shell (which are probably -c 'arguments to rsh' or something like that. I'd just wait for rc to appear in /etc/shells. Many failed attempts to get rc to do the right thing when exec-ed out of a .cshrc lead me to write: An alternative method is to invoke rc from your .profile file or its equivalent, but this has so many drawbacks that I cannot recommend it. in the rc FAQ (ftp://oldp.nmsu.edu/pub/alan/rc/rc-faq). Regards, and welcome on board, Alan From rc-owner Fri Dec 6 17:40:20 1996 Received: from weaver-gw.netapp.com ([198.95.224.2]) by hawkwind.utcs.utoronto.ca with SMTP id <24578>; Fri, 6 Dec 1996 17:39:19 -0500 Received: from netapp.com ([192.9.200.1]) by weaver.netapp.com with SMTP id <15928-25314>; Fri, 6 Dec 1996 14:40:41 -0000 Received: by netapp.com (4.1/SMI-4.1) id AA04639; Fri, 6 Dec 96 14:39:19 PST Date: Fri, 6 Dec 1996 17:39:19 -0500 From: byron@netapp.com (Byron Rakitzis) Message-Id: <9612062239.AA04639@netapp.com> To: mkgardne@cs.uiuc.edu Subject: Re: rsh and rc Cc: rc@hawkwind.utcs.toronto.edu I've seen this problem on Solaris as well, and I think my shell is in /etc/shells also. The problem is that there appears to be a bug in Solaris wait() so that it returns ECHILD even when there is a dead child outstanding. The only workaround I have found so far is to recompile with -lbsd and go with the compatability-package wait(). It appears that POSIX no longer supports the usual wait semantics. There is some other call that you are supposed to use instead -- waitpid, something like that, and I haven't bothered to learn about it yet. Nevermind that I don't have access to Solaris machines these days any more, either. Sorry, I am writing in great haste right now, I hope the above makes some sense. Byron. From rc-owner Tue Dec 31 16:56:02 1996 Received: from pertsserver.cs.uiuc.edu ([128.174.247.69]) by hawkwind.utcs.utoronto.ca with SMTP id <24603>; Tue, 31 Dec 1996 16:53:47 -0500 Received: (from mkgardne@localhost) by pertsserver.cs.uiuc.edu (8.8.4/8.8.4) id PAA05716; Tue, 31 Dec 1996 15:53:37 -0600 (CST) Date: Tue, 31 Dec 1996 16:53:37 -0500 Message-Id: <199612312153.PAA05716@pertsserver.cs.uiuc.edu> From: "Mark K. Gardner" To: rc@hawkwind.utcs.toronto.edu Subject: intr and RC Reply-to: mkgardne@cs.uiuc.edu I have been having trouble interrupting commands in RC. Sometimes when I ctl-c (which I have intr set to) the command fails to stop. Other times it stops just fine. (Naturally, it fails to stop when I have invoked a long running program, rather than when it is a short running command.) I did not find any mention of the problem on the rc-list. Has anyone else seen this? Any suggestion on how to find the problem? Configuration: rc-1.5 (linux version from sunsite which differs from the official 1.5beta in its add-ons), Solaris v2.5.1, readline, static linkage, gcc v2.7.1 with -O2 and with a hack for ~/ (which I cannot see how it would prevent intr from being acknowledged). -- Mark K. Gardner (mkgardne@cs.uiuc.edu) University of Illinois at Urbana-Champaign Real-Time Systems Laboratory -- From rc-owner Tue Dec 31 17:02:20 1996 Received: from cs.uchicago.edu ([128.135.11.87]) by hawkwind.utcs.utoronto.ca with SMTP id <24603>; Tue, 31 Dec 1996 17:01:52 -0500 Received: from gargoyle164.cs.uchicago.edu (gargoyle20 [128.135.20.100]) by cs.uchicago.edu (8.8.3/8.7.3) with ESMTP id QAA05036; Tue, 31 Dec 1996 16:01:37 -0600 (CST) Received: (from csdayton@localhost) by gargoyle164.cs.uchicago.edu (8.8.3/8.7.3) id QAA08956; Tue, 31 Dec 1996 16:01:36 -0600 (CST) To: mkgardne@cs.uiuc.edu Cc: rc@hawkwind.utcs.toronto.edu Subject: Re: intr and RC References: <199612312153.PAA05716@pertsserver.cs.uiuc.edu> Mime-Version: 1.0 (generated by tm-edit 7.94) Content-Type: text/plain; charset=US-ASCII From: Soren Dayton Date: Tue, 31 Dec 1996 17:01:35 -0500 In-Reply-To: "Mark K. Gardner"'s message of Tue, 31 Dec 1996 16:53:37 -0500 Message-ID: Lines: 16 X-Mailer: Gnus v5.3/XEmacs 19.14 "Mark K. Gardner" writes: > I have been having trouble interrupting commands in RC. Sometimes when > I ctl-c (which I have intr set to) the command fails to stop. Other > times it stops just fine. (Naturally, it fails to stop when I have > invoked a long running program, rather than when it is a short running > command.) I did not find any mention of the problem on the rc-list. > Has anyone else seen this? Any suggestion on how to find the problem? I have not looked at the rc code in a while, but this problem appeared in es and it turned out that we should be using sigsetjmp() and siglongjmp() rather than longjmp() and setjmp(). Just a pointer... Soren From rc-owner Tue Jan 7 12:08:13 1997 Received: from perts6.cs.uiuc.edu ([128.174.247.68]) by hawkwind.utcs.utoronto.ca with SMTP id <24611>; Tue, 7 Jan 1997 12:04:09 -0500 Received: (from mkgardne@localhost) by perts6.cs.uiuc.edu (8.8.4/8.8.4) id LAA05449; Tue, 7 Jan 1997 11:03:59 -0600 (CST) Date: Tue, 7 Jan 1997 12:03:59 -0500 Message-Id: <199701071703.LAA05449@perts6.cs.uiuc.edu> From: "Mark K. Gardner" To: rc@hawkwind.utcs.toronto.edu Subject: RE: intr and RC Reply-to: mkgardne@cs.uiuc.edu mark> I have been having trouble interrupting commands in RC. mark> Sometimes when I ctl-c (which I have intr set to) the command mark> fails to stop. Other times it stops just fine. (Naturally, it mark> fails to stop when I have invoked a long running program, mark> rather than when it is a short running command.) I did not mark> find any mention of the problem on the rc-list. Has anyone mark> else seen this? Any suggestion on how to find the problem? mark> Configuration: mark> rc-1.5 (linux version from sunsite which differs from the mark> official 1.5beta in its add-ons), Solaris v2.5.1, readline, mark> static linkage, gcc v2.7.1 with -O2 and with a hack for mark> ~/ (which I cannot see how it would prevent mark> intr from being acknowledged). Soren> I have not looked at the rc code in a while, but this problem Soren> appeared in es and it turned out that we should be using Soren> sigsetjmp() and siglongjmp() rather than longjmp() and Soren> setjmp(). I implemented the suggestion that Soren Dayton made (the difference between SysV4 and BSD setjmp/longjmp is documented in the Solaris Porting FAQ on sunsite), but the problem still exists. I can't believe that I am the only one using rc on Solaris. Has anyone else managed to compile rc and get interrupts to work properly? I *love* rc, but this is driving me crazy! -- Mark K. Gardner (mkgardne@cs.uiuc.edu) University of Illinois at Urbana-Champaign Real-Time Systems Laboratory -- From rc-owner Tue Jan 7 12:19:26 1997 Received: from galapagos.cse.psu.edu ([130.203.2.12]) by hawkwind.utcs.utoronto.ca with SMTP id <24612>; Tue, 7 Jan 1997 12:17:32 -0500 Received: by galapagos.cse.psu.edu id <12685>; Tue, 7 Jan 1997 12:17:01 -0500 To: mkgardne@cs.uiuc.edu cc: rc@hawkwind.utcs.toronto.edu Subject: Re: intr and RC In-reply-to: Your message of "Tue, 07 Jan 1997 12:03:59 EST." <199701071703.LAA05449@perts6.cs.uiuc.edu> Date: Tue, 7 Jan 1997 12:16:46 -0500 From: Scott Schwartz Message-Id: <97Jan7.121701est.12685@galapagos.cse.psu.edu> "Mark K. Gardner" writes: | I implemented the suggestion that Soren Dayton made (the difference | between SysV4 and BSD setjmp/longjmp is documented in the Solaris | Porting FAQ on sunsite), but the problem still exists. I can't believe | that I am the only one using rc on Solaris. Has anyone else managed to | compile rc and get interrupts to work properly? I *love* rc, but this | is driving me crazy! I compiled it (CFLAGS=-DSYSVR4), and it works fine with no changes, so far as I can tell. From rc-owner Tue Jan 7 12:55:51 1997 Received: from netcom9.netcom.com ([192.100.81.119]) by hawkwind.utcs.utoronto.ca with SMTP id <24614>; Tue, 7 Jan 1997 12:53:52 -0500 Received: (from haahr@localhost) by netcom9.netcom.com (8.6.13/Netcom) id JAA09487; Tue, 7 Jan 1997 09:46:58 -0800 Date: Tue, 7 Jan 1997 12:46:58 -0500 From: haahr@netcom.com (Paul Haahr) Message-Id: <199701071746.JAA09487@netcom9.netcom.com> To: "Mark K. Gardner" Cc: rc@hawkwind.utcs.toronto.edu Subject: RE: intr and RC In-Reply-To: <199701071703.LAA05449@perts6.cs.uiuc.edu> References: <199701071703.LAA05449@perts6.cs.uiuc.edu> > I implemented the suggestion that Soren Dayton made (the difference > between SysV4 and BSD setjmp/longjmp is documented in the Solaris > Porting FAQ on sunsite), but the problem still exists. I can't believe > that I am the only one using rc on Solaris. Has anyone else managed to > compile rc and get interrupts to work properly? I *love* rc, but this > is driving me crazy! Do you compile -lbsd? As I remember, Byron had to do that to get signals to work properly for him. (As an aside, a SunOS 4.x binary of rc will probably work correctly on rc where a Solaris 2.5 binary compiled w/o -lbsd will do the wrong thing.) From rc-owner Tue Jan 7 13:02:09 1997 Received: from oldp.nmsu.edu ([128.123.26.31]) by hawkwind.utcs.utoronto.ca with SMTP id <24615>; Tue, 7 Jan 1997 13:00:56 -0500 Received: by oldp.nmsu.edu; id AA05608; Tue, 7 Jan 1997 11:00:40 -0700 Date: Tue, 7 Jan 1997 13:00:40 -0500 From: Alan Watson Message-Id: <9701071800.AA05608@oldp.nmsu.edu> To: rc@hawkwind.utcs.toronto.edu Subject: RE: intr and RC Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit > (As an aside, a SunOS 4.x binary of rc will probably work correctly on > rc where a Solaris 2.5 binary compiled w/o -lbsd will do the wrong thing.) My experience is that a SunOS 4.x binary traps the first interrupt successfully, but then exits on the second. Regards, Alan From rc-owner Tue Jan 7 14:56:01 1997 Received: from oldp.nmsu.edu ([128.123.26.31]) by hawkwind.utcs.utoronto.ca with SMTP id <24611>; Tue, 7 Jan 1997 14:55:44 -0500 Received: by oldp.nmsu.edu; id AA05252; Tue, 7 Jan 1997 12:55:14 -0700 Date: Tue, 7 Jan 1997 14:55:14 -0500 From: Alan Watson Message-Id: <9701071955.AA05252@oldp.nmsu.edu> To: rc@hawkwind.utcs.toronto.edu Subject: Re: intr and RC Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit I've looked at this for a little while and these diffs seems to work for me on SunOS charon 5.5 Generic sun4u sparc SUNW,Ultra-1 when compiled with c89 and without -lbsd or -lreadline. There seem to be two things to get right: the behaviour on interrupts with and without a handler. I think this does the right thing, but rc signals are pretty much Greek to me. Regards, Alan *** config.h.orig Tue Jan 7 12:39:57 1997 --- config.h Tue Jan 7 12:39:46 1997 *************** *** 130,140 **** #define DEFAULTPATH "/usr/bsd", "/usr/sbin", "/usr/bin", "/bin", "." #endif ! #ifdef sun /* Used on SunOS 4.1.1 */ ! #define PROTECT_ENV ! #undef DEFAULTPATH ! #define DEFAULTPATH "/usr/ucb", "/usr/bin", "." #endif /* * Suggested settings for HP300 running 4.3BSD-utah (DWS): --- 130,151 ---- #define DEFAULTPATH "/usr/bsd", "/usr/sbin", "/usr/bin", "/bin", "." #endif ! #ifdef sun ! #ifdef __SVR4 /* Used on Solaris */ ! #ifndef SYSVR4 ! #define SYSVR4 ! #endif ! #define NOSIGCLD ! #define SVSIGS ! #define PROTECT_ENV ! #undef DEFAULTPATH ! #define DEFAULTPATH "/usr/ucb", "/usr/bin", "." ! #else /* Used on SunOS 4.1.1 */ ! #define PROTECT_ENV ! #undef DEFAULTPATH ! #define DEFAULTPATH "/usr/ucb", "/usr/bin", "." #endif + #endif /* * Suggested settings for HP300 running 4.3BSD-utah (DWS): *** input.c.orig Tue Jan 7 11:03:30 1997 --- input.c Tue Jan 7 12:52:00 1997 *************** *** 137,144 **** } else #endif { ! long /*ssize_t*/ r = rc_read(istack->fd, inbuf + 2, BUFSIZE); ! sigchk(); if (r < 0) { uerror("read"); rc_exit(1); --- 137,148 ---- } else #endif { ! long /*ssize_t*/ r; ! do { ! errno = 0; ! r = rc_read(istack->fd, inbuf + 2, BUFSIZE); ! sigchk(); ! } while (r < 0 && errno == EINTR); if (r < 0) { uerror("read"); rc_exit(1); From rc-owner Wed Jan 8 03:36:20 1997 Received: from glacier.wise.edt.ericsson.se ([193.180.251.38]) by hawkwind.utcs.utoronto.ca with SMTP id <24611>; Wed, 8 Jan 1997 03:34:25 -0500 Received: from eua.eua.ericsson.se (eua.eua.ericsson.se [134.138.132.16]) by glacier.wise.edt.ericsson.se (8.7.5/8.7.3/glacier-0.9) with SMTP id IAA15023 for ; Wed, 8 Jan 1997 08:45:19 +0100 (MET) Received: from ms.uab.ericsson.se by eua.eua.ericsson.se (4.1/EUA-2.1) id AA13484; Wed, 8 Jan 97 08:45:11 +0100 Received: from uabx01c184.uab.ericsson.se by ms.uab.ericsson.se (4.1/MS-2.1) id AA14034; Wed, 8 Jan 97 08:45:09 +0100 From: Bengt.Kleberg@uab.ericsson.se (Bengt Kleberg) Received: by uabx01c184.uab.ericsson.se (SMI-8.6/client-1.3) id IAA16657; Wed, 8 Jan 1997 08:45:08 +0100 Date: Wed, 8 Jan 1997 02:45:08 -0500 Message-Id: <199701080745.IAA16657@uabx01c184.uab.ericsson.se> To: rc@hawkwind.utcs.toronto.edu Subject: Re: intr and RC X-Sun-Charset: US-ASCII > From: Scott Schwartz > > "Mark K. Gardner" writes: > | Has anyone else managed to > | compile rc and get interrupts to work properly? I *love* rc, but this > | is driving me crazy! > > I compiled it (CFLAGS=-DSYSVR4), and it works fine with no changes, > so far as I can tell. > Ditto. Best Wishes, Bengt -------------------------------------------------------------------- Email: Bengt.Kleberg@enea.se (Enea Data AB, Sweden) Disclaimer: Nothing abovementioned has any connection to Enea Data AB ``At the moment money does indeed make the world go round but unfortunately the direction of that applied rotation is all downhill.'' fleecy@netreach.net From rc-owner Wed Jan 8 18:10:00 1997 Received: from perts6.cs.uiuc.edu ([128.174.247.68]) by hawkwind.utcs.utoronto.ca with SMTP id <24656>; Wed, 8 Jan 1997 18:06:12 -0500 Received: (from mkgardne@localhost) by perts6.cs.uiuc.edu (8.8.4/8.8.4) id OAA08516; Wed, 8 Jan 1997 14:01:18 -0600 (CST) Date: Wed, 8 Jan 1997 15:01:18 -0500 Message-Id: <199701082001.OAA08516@perts6.cs.uiuc.edu> From: "Mark K. Gardner" To: rc@hawkwind.utcs.toronto.edu Subject: RE: intr and RC Reply-to: mkgardne@cs.uiuc.edu I have the intr working with rc now. The solution (with credits): * convert setjmp/longjmp to sigsetjmp/siglongjmp (Soren Dayton) * #define SVSIGS in config.h (I forgot who suggested it) * compiled with -DSYSVR4 (Scott Schwartz) * could not link with -lbsd, no such library on Solaris (Paul Haahr) * sigchk patch for input.c (Alan Watson) along with the following: * convert readline setjmp/longjmp (hint: Alan Watson's readline-less post) Thanks all who responded. I have a patch file for the above changes. Where should I submit it? -- Mark K. Gardner (mkgardne@cs.uiuc.edu) University of Illinois at Urbana-Champaign Real-Time Systems Laboratory -- From rc-owner Thu Jan 9 16:10:11 1997 Received: from quay.pipex.net ([158.43.128.34]) by hawkwind.utcs.utoronto.ca with SMTP id <23993>; Thu, 9 Jan 1997 16:06:12 -0500 Received: (qmail 17962 invoked from network); 9 Jan 1997 11:09:10 -0000 Received: from pool.uunet.pipex.com (158.43.134.17) by quay.uunet.pipex.com with QMTP; 9 Jan 1997 11:09:10 -0000 In-Reply-To: <199701082001.OAA08516@perts6.cs.uiuc.edu> To: rc@hawkwind.utcs.toronto.edu Subject: Re: intr and RC Date: Thu, 9 Jan 1997 06:09:09 -0500 From: Tim Goodwin Message-ID: > Thanks all who responded. I have a patch file for the above changes. > Where should I submit it? Way, way back in June 1995, I volunteered to pick up the rc baton from Byron. The bad news is, since then I've done almost exactly nothing with rc. The good news is, I've recently been rearranging my personal life so that I will have more time to spend on various projects, and rc is near the top of the list. So, send your patch to me, and I'll see about incorporating it into 1.5.2. I'm afraid I can't at the moment say when I'll have a new beta for you all to play with, but I hope it will be within a few months at most... I do apologize sincerely for my lack of activity on the rc front. Tim. From rc-owner Thu Jan 9 18:59:09 1997 Received: from cse.psu.edu ([130.203.3.50]) by hawkwind.utcs.utoronto.ca with SMTP id <23995>; Thu, 9 Jan 1997 18:57:54 -0500 Received: from vorlon.cse.psu.edu (schwartz@vorlon.cse.psu.edu [130.203.30.21]) by cse.psu.edu (8.7.5/8.7.3) with ESMTP id RAA04963; Thu, 9 Jan 1997 17:00:40 -0500 (EST) From: Scott Schwartz Received: (from schwartz@localhost) by vorlon.cse.psu.edu (8.7.6/8.7.3) id QAA02203; Thu, 9 Jan 1997 16:59:47 -0500 (EST) Date: Thu, 9 Jan 1997 16:59:47 -0500 Message-Id: <199701092159.QAA02203@vorlon.cse.psu.edu> To: rc@hawkwind.utcs.toronto.edu, tim@uunet.pipex.com Subject: Re: intr and RC What exactly is the bug? Until someone can explain what is going on, I'd rather not see the patch be official. (Maybe I just haven't exercised Solaris hard enough, but I haven't run across problems.) From rc-owner Sun Jan 12 18:19:12 1997 Received: from weaver-gw.netapp.com ([198.95.224.2]) by hawkwind.utcs.utoronto.ca with SMTP id <23979>; Sun, 12 Jan 1997 18:17:22 -0500 Received: from netapp.com ([192.9.200.1]) by weaver.netapp.com with SMTP id <15925-7374>; Sun, 12 Jan 1997 15:16:33 -0000 Received: by netapp.com (4.1/SMI-4.1) id AA19758; Sun, 12 Jan 97 15:17:16 PST Date: Sun, 12 Jan 1997 18:17:16 -0500 From: byron@netapp.com (Byron Rakitzis) Message-Id: <9701122317.AA19758@netapp.com> To: rc@hawkwind.utcs.toronto.edu, schwartz@cse.psu.edu, tim@uunet.pipex.com Subject: Re: intr and RC I am not sure what this bug is but the bug that last bit me with Solaris and which I consider a showstopper is this: rsh solaris-machine ls The last time I ran this command rc would hang after running ls, because rc on the solaris machine was getting no child pids back from wait(). I don't know if it's worth doing a 1.5.2 for Solaris unless this bug is fixed. It doesn't have anything to do with setjmp and longjmp and signals as far as I know. I got around this bug running a 4.1.x binary, or linking with a bsd library. It may not be called -lbsd, but there is some kind of compatability library for BSD available. From rc-owner Sun Jan 12 18:40:09 1997 Received: from cse.psu.edu ([130.203.3.50]) by hawkwind.utcs.utoronto.ca with SMTP id <23978>; Sun, 12 Jan 1997 18:39:49 -0500 Received: from vorlon.cse.psu.edu (schwartz@vorlon.cse.psu.edu [130.203.30.21]) by cse.psu.edu (8.7.5/8.7.3) with ESMTP id SAA03560; Sun, 12 Jan 1997 18:40:16 -0500 (EST) From: Scott Schwartz Received: (from schwartz@localhost) by vorlon.cse.psu.edu (8.7.6/8.7.3) id SAA08864; Sun, 12 Jan 1997 18:39:16 -0500 (EST) Date: Sun, 12 Jan 1997 18:39:16 -0500 Message-Id: <199701122339.SAA08864@vorlon.cse.psu.edu> To: byron@netapp.com, rc@hawkwind.utcs.toronto.edu Subject: Re: intr and RC I am not sure what this bug is but the bug that last bit me with Solaris and which I consider a showstopper is this: rsh solaris-machine ls The last time I ran this command rc would hang after running ls, because rc on the solaris machine was getting no child pids back from wait(). I can't reproduce that, with a recent version of solaris. % uname -a SunOS vorlon.cse.psu.edu 5.5.1 Generic_103640-03 sun4m sparc SUNW,SPARCstation-4 % cc -V cc: SC4.0 18 Oct 1995 C 4.0 Here are all the changes I've made to the distributed code: % rcsdiff -c RCS/* *** /tmp/T0a00295 Sun Jan 12 18:29:27 1997 --- Makefile Fri May 31 02:08:02 1996 *************** *** 16,28 **** #ADDON=addon.o # Use an ANSI compiler (or at least one that groks prototypes and void *): ! CC=gcc -g -O ! CFLAGS= LDFLAGS= # You may substitute "bison -y" for yacc. (You want to choose the one that # makes a smaller y.tab.c. Also see the README about Sun's yacc.) ! YACC=yacc OBJS=$(ADDON) builtins.o except.o exec.o $(EXECVE) fn.o footobar.o getopt.o \ glob.o glom.o hash.o heredoc.o input.o lex.o list.o main.o match.o \ --- 16,30 ---- #ADDON=addon.o # Use an ANSI compiler (or at least one that groks prototypes and void *): ! CC=cc ! # -cg92 ! #CC=insight ! CFLAGS= -O -fast -DSYSVR4 LDFLAGS= # You may substitute "bison -y" for yacc. (You want to choose the one that # makes a smaller y.tab.c. Also see the README about Sun's yacc.) ! YACC=bison -y OBJS=$(ADDON) builtins.o except.o exec.o $(EXECVE) fn.o footobar.o getopt.o \ glob.o glom.o hash.o heredoc.o input.o lex.o list.o main.o match.o \ No differences encountered *** /tmp/T0a00295 Sun Jan 12 18:29:27 1997 --- footobar.c Fri May 31 01:45:46 1996 *************** *** 9,15 **** #ifdef PROTECT_ENV static bool Fconv(Format *f, int ignore) { ! unsigned const char *s = va_arg(f->args, unsigned const char *); int c; while ((c = *s++) != '\0') --- 9,15 ---- #ifdef PROTECT_ENV static bool Fconv(Format *f, int ignore) { ! const unsigned char *s = va_arg(f->args, const unsigned char *); int c; while ((c = *s++) != '\0') *** /tmp/T0a00295 Sun Jan 12 18:29:27 1997 --- input.c Fri May 31 01:45:47 1996 *************** *** 140,145 **** --- 140,147 ---- long /*ssize_t*/ r = rc_read(istack->fd, inbuf + 2, BUFSIZE); sigchk(); if (r < 0) { + if (errno == EINTR) /*retry interrupted read*/ + continue; uerror("read"); rc_exit(1); } *** /tmp/T0a00295 Sun Jan 12 18:29:28 1997 --- print.c Fri May 31 01:45:44 1996 *************** *** 219,225 **** */ extern void fmtappend(Format *format, const char *s, SIZE_T len) { ! while (format->buf + len > format->bufend) { SIZE_T split = format->bufend - format->buf; memcpy(format->buf, s, split); format->buf += split; --- 219,225 ---- */ extern void fmtappend(Format *format, const char *s, SIZE_T len) { ! while (len > format->bufend - format->buf) { SIZE_T split = format->bufend - format->buf; memcpy(format->buf, s, split); format->buf += split; *************** *** 240,246 **** */ extern int printfmt(Format *format, const char *fmt) { ! unsigned const char *s = (unsigned const char *) fmt; if (fmttab[0] == NULL) inittab(); --- 240,246 ---- */ extern int printfmt(Format *format, const char *fmt) { ! const unsigned char *s = (const unsigned char *) fmt; if (fmttab[0] == NULL) inittab(); *************** *** 314,319 **** --- 314,320 ---- static void memprint_grow(Format *format, SIZE_T more) { char *buf; + SIZE_T pos = format->buf - format->bufbegin; SIZE_T len = format->bufend - format->bufbegin + 1; len = (len >= more) ? len * 2 *************** *** 325,331 **** buf = nalloc(len); memcpy(buf, format->bufbegin, used); } ! format->buf = buf + (format->buf - format->bufbegin); format->bufbegin = buf; format->bufend = buf + len - 1; } --- 326,332 ---- buf = nalloc(len); memcpy(buf, format->bufbegin, used); } ! format->buf = buf + pos; format->bufbegin = buf; format->bufend = buf + len - 1; } *** /tmp/T0a00295 Sun Jan 12 18:29:29 1997 --- signal.c Fri May 31 01:45:50 1996 *************** *** 66,72 **** void (*h)(int); int i; for (i = 1; i < NUMOFSIGNALS; i++) { ! if ((h = signal(i, SIG_DFL)) != SIG_DFL) signal(i, h); sighandlers[i] = h; } --- 66,73 ---- void (*h)(int); int i; for (i = 1; i < NUMOFSIGNALS; i++) { ! h = signal(i, SIG_DFL); ! if (h != SIG_ERR && h != SIG_DFL) signal(i, h); sighandlers[i] = h; } From rc-owner Sun Jan 12 19:53:34 1997 Received: from elysium.uwa.edu.au ([130.95.128.2]) by hawkwind.utcs.utoronto.ca with SMTP id <23980>; Sun, 12 Jan 1997 19:53:06 -0500 Received: from typhaon.ucs.uwa.edu.au (luyer@typhaon.ucs.uwa.edu.au [130.95.128.64]) by elysium.uwa.edu.au (8.8.2/8.8.0) with SMTP id IAA20780; Mon, 13 Jan 1997 08:53:22 +0800 (WST) Date: Sun, 12 Jan 1997 19:52:50 -0500 From: David Luyer Reply-To: David Luyer To: Scott Schwartz cc: byron@netapp.com, rc@hawkwind.utcs.toronto.edu Subject: Re: intr and RC In-Reply-To: <199701122339.SAA08864@vorlon.cse.psu.edu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Sun, 12 Jan 1997, Scott Schwartz wrote (quoting byron@netapp.com): > I am not sure what this bug is but the bug that last bit me with > Solaris and which I consider a showstopper is this: > > rsh solaris-machine ls > > The last time I ran this command rc would hang after running ls, > because rc on the solaris machine was getting no child pids back > from wait(). Using standard rc-1.4 and "rcp file solaris-machine:" to a recent version of Solaris, I get "rc" on the solaris machine hanging taking all CPU in an infinite loop (most, if not all the time). OS is "SunOS sage 5.5 Generic sun4c sparc SUNW,Sun_4_40" with a variety of patches. Is this reproducable for you? I haven't really looked at it, because the Solaris machines here aren't particularly worth thinking about :) It just means a hang whenever I use my 'distribute-rcrc' function to copy my rcrc across 20+ machines of differing architectures; Solaris is the only place I have a problem. David. PS: Does anyone have rc 1..4 compiled for SCO unix, preferably with readline support? We don't have a compiler on our SCO box and installing a cross-compiler elsewhere to compile rc would seem a little excessive. From rc-owner Sun Jan 12 20:34:34 1997 Received: from cse.psu.edu ([130.203.3.50]) by hawkwind.utcs.utoronto.ca with SMTP id <23993>; Sun, 12 Jan 1997 20:34:11 -0500 Received: from vorlon.cse.psu.edu (schwartz@vorlon.cse.psu.edu [130.203.30.21]) by cse.psu.edu (8.7.5/8.7.3) with ESMTP id UAA04168; Sun, 12 Jan 1997 20:34:44 -0500 (EST) From: Scott Schwartz Received: (from schwartz@localhost) by vorlon.cse.psu.edu (8.7.6/8.7.3) id UAA10370; Sun, 12 Jan 1997 20:33:44 -0500 (EST) Date: Sun, 12 Jan 1997 20:33:44 -0500 Message-Id: <199701130133.UAA10370@vorlon.cse.psu.edu> To: luyer@ucs.uwa.edu.au Cc: rc@hawkwind.utcs.toronto.edu Subject: Re: intr and RC scp with rc1.5 works for me. From rc-owner Tue Feb 11 16:35:22 1997 Received: from faui01.informatik.uni-erlangen.de ([131.188.2.1]) by hawkwind.utcs.utoronto.ca with SMTP id <24636>; Tue, 11 Feb 1997 16:32:22 -0500 Received: (from msfriedl@localhost) by cip.informatik.uni-erlangen.de id OAA04676 (8.7.6/7.5c-FAU); Tue, 11 Feb 1997 14:57:36 +0100 (MET) From: Markus Friedl Message-Id: <199702111357.OAA04676@faui01.informatik.uni-erlangen.de> Subject: Re: intr and RC To: luyer@ucs.uwa.edu.au Date: Tue, 11 Feb 1997 08:57:36 -0500 Cc: rc@hawkwind.utcs.toronto.edu In-Reply-To: from "David Luyer" at Jan 12, 97 07:52:50 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit hello! > Using standard rc-1.4 and "rcp file solaris-machine:" to a recent version > of Solaris, I get "rc" on the solaris machine hanging taking all CPU in an > infinite loop (most, if not all the time). > > OS is "SunOS sage 5.5 Generic sun4c sparc SUNW,Sun_4_40" with a variety of > patches. > > Is this reproducable for you? I had this problem, too, when 'upgrading' from SunOS4 to Solaris2 and found help in the rc-list archive from 1994: Solaris rshd (and only Solaris) sets SIGCLD to SIG_IGN and causes wait.c to loop forever waiting for childs. You can fix this by forcing SIGCHLD to SIG_IGN in signal.c (about line 70): if(i==SIGCHLD && h==SIG_IGN) h=SIG_DFL; hope this helps, -markus From rc-owner Sun Feb 23 15:16:27 1997 Received: from mail.clark.net ([168.143.0.10]) by hawkwind.utcs.utoronto.ca with SMTP id <24623>; Sun, 23 Feb 1997 15:16:11 -0500 Received: from explorer2.clark.net (culliton@explorer2.clark.net [168.143.0.5]) by mail.clark.net (8.8.5/8.6.5) with ESMTP id PAA15737 for ; Sun, 23 Feb 1997 15:14:08 -0500 (EST) From: Tom Culliton Received: (from culliton@localhost) by explorer2.clark.net (8.8.5/8.7.1) id PAA28416 for rc@hawkwind.utcs.toronto.edu; Sun, 23 Feb 1997 15:14:10 -0500 (EST) Date: Sun, 23 Feb 1997 15:14:10 -0500 Message-Id: <199702232014.PAA28416@explorer2.clark.net> To: rc@hawkwind.utcs.toronto.edu Subject: Signal follies with rc and readline I've just spent a couple days deep C diving on the wreckage from the famous collision of the "unsinkable" rc with the gnu ship readline in the sea of linux. This was strictly hard suit stuff, and even though I've been working at 1 atmosphere, it feels like I've got the bends. OK, here's the story... RC wants to catch signals, readline wants to catch signals, and they don't play nice. This is made worse by the fact that RC assumes it's the only bull on the block, and readline (at least as of rev. 2.0) is broken and inconsistent. 8-P GNU readline assumes that if you have SIGWINCH you also have Berkley semantics and doesn't reset the handler after catching the signal. As if this wasn't bad enough, it tries to daisy chain to the "old" signal handler (in this case rc's catcher()), which will do lord only knows what, without cleaning up the terminal settings. (Since catcher() was longjmp'ing out, the terminal was hosed and rc would get EOL on the next call to readline and puke. Ignoring the EOF left you hung.) 8-P As for the rest of the signals that it catches, (SIGINT, SIGALRM SIGTSTP, SIGTTOU SIGTTIN) unless you treat readline as a "slow" system call and longjmp out of catcher() they're basically ignored, you return to the readline signal handler and it goes back into business. On POSIX systems, such as Solaris and Linux, using sigsetjmp and siglongjmp helps because readline mucks with signals and signal masks as well, and these functions save and restore those. If you do longjmp out it works OK, because readline cleans up before reraising the signal. For now my solution is to: 1) Treat readline as a slow system call, this includes applying my patch from 93.05.13, which isn't in either rc-1.5betadev-1 or rc-1.5-linux. (If you use readline you need this patch!!!) 2) for POSIX machines use sigsetjmp/siglongjmp, and pass sigsetjmp a non-zero second argument. 3) Until I can publish a patch to readline or get one from GNU, NOT longjmp on SIGWINCH when using readline. 8-P BTW - At least under RH4.1 you MUST link statically when using readline or trip.rc will hang when using -i to force interactive echoing from a subprocess. (WTF!?!) Sigh. I have NO clue on this one, probably something with a static or global in the readline librbary. Tom PS - I'm a bit fried out so let me know if this makes any sense. ;-) From rc-owner Sun Feb 23 15:30:44 1997 Received: from mail.clark.net ([168.143.0.10]) by hawkwind.utcs.utoronto.ca with SMTP id <24626>; Sun, 23 Feb 1997 15:30:24 -0500 Received: from explorer2.clark.net (culliton@explorer2.clark.net [168.143.0.5]) by mail.clark.net (8.8.5/8.6.5) with ESMTP id PAA18632; Sun, 23 Feb 1997 15:29:26 -0500 (EST) From: Tom Culliton Received: (from culliton@localhost) by explorer2.clark.net (8.8.5/8.7.1) id PAA04115; Sun, 23 Feb 1997 15:29:29 -0500 (EST) Date: Sun, 23 Feb 1997 15:29:29 -0500 Message-Id: <199702232029.PAA04115@explorer2.clark.net> To: culliton@clark.net, rc@hawkwind.utcs.toronto.edu Subject: Re: Signal follies with rc and readline Oh damn! Spoke to soon I guess, if you longjmp out of catcher for any signal that GNU readline doesn't catch or SIGWINCH which it mishandles, then it gets bunged up as well... Sigh... Back to the drawing board... From rc-owner Sun Feb 23 15:55:34 1997 Received: from cse.psu.edu ([130.203.3.50]) by hawkwind.utcs.utoronto.ca with SMTP id <24623>; Sun, 23 Feb 1997 15:55:19 -0500 Received: from eiffel.cse.psu.edu (schwartz@eiffel.cse.psu.edu [130.203.10.16]) by cse.psu.edu (8.8.5/8.7.3) with ESMTP id PAA01785 for ; Sun, 23 Feb 1997 15:55:49 -0500 (EST) Message-Id: <199702232055.PAA01785@cse.psu.edu> To: rc@hawkwind.utcs.toronto.edu Subject: solaris In-reply-to: Your message of "Sun, 23 Feb 1997 15:14:10 EST." <199702232014.PAA28416@explorer2.clark.net> Date: Sun, 23 Feb 1997 15:55:31 -0500 From: Scott Schwartz The solaris rsh discussion seems to have trailed off, so before it gets completely forgotten I want to report that Markus' analysis seems to be correct: SIGCLD must be SIG_DFL for wait to work in SysV. I'm running with that fix now, and it seems happy. From rc-owner Thu Feb 27 14:07:14 1997 Received: from np.nosc.mil ([128.49.228.66]) by hawkwind.utcs.utoronto.ca with SMTP id <24623>; Thu, 27 Feb 1997 14:03:19 -0500 Received: (qmail 9147 invoked by uid 1168); 27 Feb 1997 19:02:53 -0000 Date: Thu, 27 Feb 1997 14:02:53 -0500 Message-ID: <19970227190253.9146.qmail@np.nosc.mil> From: Vincent Broman To: imurdock@debian.org CC: rc@hawkwind.utcs.toronto.edu Subject: Update for Debian shells/rc-1.4-2 Reply-to: broman@nosc.mil -----BEGIN PGP SIGNED MESSAGE----- Ian Murdock, I took the liberty of updating the Debian package for the Plan 9 shell, rc-1.4-2, and putting my results at ftp://archimedes.nosc.mil/pub/transfer/rc-1.4-3.* for your approval and use. The MD5 hashes should be: 6a23918e5475e0e1b3eb5a8c3a1fc3e8 rc-1.4-3.deb 7a45fcf4a699f7fe9c234ce3c2947c00 rc-1.4-3.diff.gz 4bf23163eff4dc730d50fc5647a7d968 rc-1.4-3.tar.gz The diffs/patches might have a problem with a file "trip.rc" which contains a nul character. There isn't anyone actively maintaining rc just now, and there are many volunteer patches for rc floating around on its mailing list. I've installed the clearest bug fixes and most popular enhancements that would command general approval, I think. One critical bug fix takes care of the problem that 1.4-2 would die whenever you hit Control-C! I've tested this code on Linux 2.0 and on SunOS 4.1.3. Vincent Broman, code D783 Bayside Email: broman@nosc.mil Naval Command Control and Ocean Surveillance Center, RDT&E Div. San Diego, CA 92152-6222, USA Phone: +1 619 553 1641 === PGP protected mail preferred. For public key finger broman@np.nosc.mil === -----BEGIN PGP SIGNATURE----- Version: 2.6.2 iQCVAwUBMxXZxmCU4mTNq7IdAQHtUwQAsMRQXOLtSZ8RjrAC0P7tWFj0Jac+jsEv k01ro3fzM2SGxcA5pzvgYTZVy3yDoKFR5IARCzzC10y6hUk0ekAt26xwVG0Nic0u /L/aNP7ZaUsYW3rbJy7NXn/Paq1SAGeLrQ4Zg504vtBqM+SsxfjiKWwwd2bMfH94 bf9jv7Ic8OU= =5Aj9 -----END PGP SIGNATURE----- From rc-owner Thu Feb 27 14:55:04 1997 Received: from cse.psu.edu ([130.203.3.50]) by hawkwind.utcs.utoronto.ca with SMTP id <24626>; Thu, 27 Feb 1997 14:54:41 -0500 Received: from basic.cse.psu.edu (schwartz@basic.cse.psu.edu [130.203.10.12]) by cse.psu.edu (8.8.5/8.7.3) with ESMTP id OAA16349 for ; Thu, 27 Feb 1997 14:55:38 -0500 (EST) Message-Id: <199702271955.OAA16349@cse.psu.edu> To: rc@hawkwind.utcs.toronto.edu Subject: Re: Update for Debian shells/rc-1.4-2 In-reply-to: Your message of "Thu, 27 Feb 1997 14:02:53 EST." <19970227190253.9146.qmail@np.nosc.mil> Date: Thu, 27 Feb 1997 14:55:08 -0500 From: Scott Schwartz Vincent Broman writes: | There isn't anyone actively maintaining rc just now, | and there are many volunteer patches for rc floating | around on its mailing list. Byron, can't you do one last release to finish 1.5? From rc-owner Mon Mar 3 11:48:22 1997 Received: from pertsserver.cs.uiuc.edu ([128.174.247.69]) by hawkwind.utcs.utoronto.ca with SMTP id <24626>; Mon, 3 Mar 1997 11:41:31 -0500 Received: (from mkgardne@localhost) by pertsserver.cs.uiuc.edu (8.8.5/8.8.5) id KAA06206; Mon, 3 Mar 1997 10:41:06 -0600 (CST) Date: Mon, 3 Mar 1997 11:41:06 -0500 Message-Id: <199703031641.KAA06206@pertsserver.cs.uiuc.edu> From: "Mark K. Gardner" To: rc@hawkwind.utcs.toronto.edu Subject: Newsreader Recommendation Reply-to: mkgardne@cs.uiuc.edu This question is off topic. However, I would specifically like the opinions of RC users as I believe it takes a special kind of person to appreciate the delicate balance between usability and creaping featuritis. I am on the prowl for a new threaded news reader. I am looking for one that has the simple-but-usable elegance of RC. I have been using TIN which comes close, but the current beta has an annoying bug and I am tired of waiting for it to be fixed. (The previous version also has its annoying problems.) I have investigated Gnus and find it to be *the* prototype for creaping featuritis. Worst of all, it is very slow on my machine. What news readers do you use and why do you like them? What are their disadvantages? Last of all, where can one obtain the sources for them? Thanks in advance for your opinions (including dissenting ones). -- Mark K. Gardner (mkgardne@cs.uiuc.edu) University of Illinois at Urbana-Champaign Real-Time Systems Laboratory -- From rc-owner Mon Mar 3 14:10:48 1997 Received: from weaver-gw.netapp.com ([198.95.224.2]) by hawkwind.utcs.utoronto.ca with SMTP id <24626>; Mon, 3 Mar 1997 14:08:41 -0500 Received: from netapp.com ([192.9.200.1]) by weaver.netapp.com with SMTP id <15850-5564>; Mon, 3 Mar 1997 11:08:36 -0000 Received: from nova.netapp.com by netapp.com (4.1/SMI-4.1) id AA28962; Mon, 3 Mar 97 11:09:33 PST Received: by nova.netapp.com (4.1/SMI-4.1) id AA28293; Mon, 3 Mar 97 11:09:32 PST Date: Mon, 3 Mar 1997 14:09:32 -0500 From: byron@netapp.com (Byron Rakitzis) Message-Id: <9703031909.AA28293@nova.netapp.com> To: rc@hawkwind.utcs.toronto.edu, schwartz@cse.psu.edu Subject: Re: Update for Debian shells/rc-1.4-2 Hi. I should mention that I am working less now with computers than I have been in a while. I'm enrolled full time in the Utrechts Conservatorium in the Netherlands, and I'm studying baroque flute and bassoon. That being said, I don't want to see rc unravel because of lack of maintenance, and I would like to try to put together the fixes from the last while and officially release it, so it gets picked up by the GNU distrib and so on. Given that I am stuck on my own with nothing but BSD on my pc, I will have to ask for some volunteers to run trip tests. I'll mention it again on the list once I get my act together so I can incorporate these patches. Byron. From rc-owner Mon Mar 3 21:03:20 1997 Received: from mail.clark.net ([168.143.0.10]) by hawkwind.utcs.utoronto.ca with SMTP id <24628>; Mon, 3 Mar 1997 21:02:29 -0500 Received: from explorer2.clark.net (culliton@explorer2.clark.net [168.143.0.5]) by mail.clark.net (8.8.5/8.6.5) with ESMTP id VAA25859 for ; Mon, 3 Mar 1997 21:01:24 -0500 (EST) From: Tom Culliton Received: (from culliton@localhost) by explorer2.clark.net (8.8.5/8.7.1) id VAA29960 for rc@hawkwind.utcs.toronto.edu; Mon, 3 Mar 1997 21:01:12 -0500 (EST) Date: Mon, 3 Mar 1997 21:01:12 -0500 Message-Id: <199703040201.VAA29960@explorer2.clark.net> To: rc@hawkwind.utcs.toronto.edu Subject: Re: Update for Debian shells/rc-1.4-2 Oh bother! It must be one of those days. This apprently bounced, the first time, wonder how much other stuff hasn't gotten through. Chris tells me: cks> The configuration thing that caused the bounce message you got has been cks>fixed; you should be able to resend your message and have it get through cks>now. In any case... > Given that I am stuck on my own with nothing but BSD on my pc, I will > have to ask for some volunteers to run trip tests. I'll mention it > again on the list once I get my act together so I can incorporate > these patches. > > Byron. I'll volunteer to do the Linux and AIX testing, since those are the two platforms I'm working on these days. I'd also be happy to put my Linux machine at your disposal, (i.e. to put it on the net and give you a login) if you want to try anything yourself. Tom From rc-owner Mon Mar 3 22:34:42 1997 Received: from elysium.uwa.edu.au ([130.95.128.2]) by hawkwind.utcs.utoronto.ca with SMTP id <24628>; Mon, 3 Mar 1997 22:34:22 -0500 Received: from typhaon.ucs.uwa.edu.au (luyer@typhaon.ucs.uwa.edu.au [130.95.128.64]) by elysium.uwa.edu.au (8.8.2/8.8.0) with SMTP id LAA20658 for ; Tue, 4 Mar 1997 11:34:10 +0800 (WST) Date: Mon, 3 Mar 1997 22:34:27 -0500 From: David Luyer To: rc@hawkwind.utcs.toronto.edu Subject: Re: Update for Debian shells/rc-1.4-2 In-Reply-To: <9703031909.AA28293@nova.netapp.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII One thing wrong with the current Debian rc-1.4 package is that it dies on a ^C - almost totally useless. This is because the wrong include file was used for mksignal in the build (should be /usr/include/asm/signal.h). As a result it installs no handler for SIGINT it seems. Personally I always prefer a more verbose sigmsgs.c, viz: Sigmsgs signals[] = { {"", ""}, {"sighup", "hangup detected"}, {"sigint", "interrupt from keyboard"}, {"sigquit", "quit from keyboard"}, {"sigill", "illegal instruction"}, {"sigtrap", "trace/breakpoint trap"}, {"sigabrt", "abort"}, {"sigbus", "bus error"}, {"sigfpe", "floating point exception"}, {"sigkill", "killed"}, {"sigusr1", "user signal 1"}, {"sigsegv", "segmentation violation"}, {"sigusr2", "user signal 2"}, {"sigpipe", "pipe fault"}, {"sigalrm", "alarm"}, {"sigterm", "terminated"}, {"sigstkflt", "stack fault on coprocessor"}, {"sigchld", "child stop or exit"}, {"sigcont", "continue"}, {"sigstop", "stopped"}, {"sigtstp", "stop signal from tty"}, {"sigttin", "background tty read"}, {"sigttou", "background tty write"}, {"sigurg", "urgent condition on i/o channel"}, {"sigxcpu", "cpu time limit exceeded"}, {"sigxfsz", "file size limit exceeded"}, {"sigvtalrm", "vitual time alarm"}, {"sigprof", "profile signal"}, {"sigwinch", "window resize"}, {"sigio", "i/o error"}, {"sigpwr", "power fault"}, {"sigunused", "unused signal"}, }; David. From rc-owner Mon Mar 3 22:51:42 1997 Received: from cs.uchicago.edu ([128.135.11.87]) by hawkwind.utcs.utoronto.ca with SMTP id <24629>; Mon, 3 Mar 1997 22:51:25 -0500 Received: from jordan.cs.uchicago.edu (jordan [128.135.164.50]) by cs.uchicago.edu (8.8.5/8.7.3) with ESMTP id VAA20217; Mon, 3 Mar 1997 21:51:09 -0600 (CST) Received: from jordan (localhost [127.0.0.1]) by jordan.cs.uchicago.edu (8.8.5/8.7.3) with ESMTP id VAA29275; Mon, 3 Mar 1997 21:51:09 -0600 (CST) X-Face: `X="Sg7A[PL3/_8;>>ggjOy&\KtWiH7.wQ>Y"hQ2fxSG9RkPTCT}&^()5[Gp(-DaTf:t`MSBt@Li_C9U@y#i/c?i$uLQ8[';I$mMAm_rZta>l`STW_aA5`iD[!80p#_qmN4#tMu[Pu7wkIi)5*4YXAhg)9R2-BAWPbVOzgE$Ib4QuZn0YaE~'C/7h^CTuPybz$u To: David Luyer Cc: rc@hawkwind.utcs.toronto.edu Subject: Re: Update for Debian shells/rc-1.4-2 References: Mime-Version: 1.0 (generated by tm-edit 7.101) Content-Type: text/plain; charset=US-ASCII From: Soren Dayton Date: Mon, 3 Mar 1997 22:51:08 -0500 In-Reply-To: David Luyer's message of Mon, 3 Mar 1997 22:34:27 -0500 Message-ID: Lines: 11 X-Mailer: Gnus v5.4.12/XEmacs 20.0 Sender: csdayton@cs.uchicago.edu David Luyer writes: > One thing wrong with the current Debian rc-1.4 package is that it dies on > a ^C - almost totally useless. This is because the wrong include file was > used for mksignal in the build (should be /usr/include/asm/signal.h). As > a result it installs no handler for SIGINT it seems. I have `autoconf'ed es. Would the rc people be interested in this. I suspect that it would work for rc pretty much out of the box. Soren From rc-owner Tue Mar 4 09:48:07 1997 Received: from pertsserver.cs.uiuc.edu ([128.174.247.69]) by hawkwind.utcs.utoronto.ca with SMTP id <24628>; Tue, 4 Mar 1997 09:47:14 -0500 Received: (from mkgardne@localhost) by pertsserver.cs.uiuc.edu (8.8.5/8.8.5) id IAA09487; Tue, 4 Mar 1997 08:46:58 -0600 (CST) Date: Tue, 4 Mar 1997 09:46:58 -0500 Message-Id: <199703041446.IAA09487@pertsserver.cs.uiuc.edu> From: "Mark K. Gardner" To: rc@hawkwind.utcs.toronto.edu cc: byron@netapp.com Subject: Re: Helping with RC Reply-to: mkgardne@cs.uiuc.edu -- Byron, the Great said: > Given that I am stuck on my own with nothing but BSD on my pc, I will > have to ask for some volunteers to run trip tests. I'll mention it > again on the list once I get my act together so I can incorporate > these patches. I volunteer to test the Solaris version of RC. I have had some trouble in the past getting it to work correctly and want to make sure there is an official version which supports Solaris. (Our computer support department has standardized on Solaris and I want RC!) Thanks for the good work in getting/keeping RC rolling. Good luck on your music studies. -- Mark K. Gardner (mkgardne@cs.uiuc.edu) University of Illinois at Urbana-Champaign Real-Time Systems Laboratory -- From rc-owner Tue Mar 4 09:57:47 1997 Received: from pertsserver.cs.uiuc.edu ([128.174.247.69]) by hawkwind.utcs.utoronto.ca with SMTP id <24629>; Tue, 4 Mar 1997 09:57:36 -0500 Received: (from mkgardne@localhost) by pertsserver.cs.uiuc.edu (8.8.5/8.8.5) id IAA09534; Tue, 4 Mar 1997 08:57:32 -0600 (CST) Date: Tue, 4 Mar 1997 09:57:32 -0500 Message-Id: <199703041457.IAA09534@pertsserver.cs.uiuc.edu> From: "Mark K. Gardner" To: rc@hawkwind.utcs.toronto.edu Subject: if Suggestion Reply-to: mkgardne@cs.uiuc.edu Since Byron is beginning work on a new official version of RC, I would like to make a suggestion about the if statement. One of the things which attracted me to RC initially was its "more C-like syntax than csh". However, I find myself wanting to have an optional else-if clause in the if statement. I realize that there are other ways of expressing the same control flow, but either they look very cumbersome to me (nested if statements) or I get lost in complexity of expressions connected by && and ||. Is it heresy to suggest that we add an optional else-if to the if statement? I am not opposed to the keyword "elsif" (as used in several other languages) to avoid the dangling else problem. (There goes the likeness to C!) -- Mark K. Gardner (mkgardne@cs.uiuc.edu) University of Illinois at Urbana-Champaign Real-Time Systems Laboratory -- From rc-owner Tue Mar 4 10:22:00 1997 Received: from holly.cam.harlequin.co.uk ([193.128.4.58]) by hawkwind.utcs.utoronto.ca with SMTP id <24628>; Tue, 4 Mar 1997 10:21:45 -0500 Received: from propos.long.harlequin.co.uk (propos.long.harlequin.co.uk [193.128.93.50]) by holly.cam.harlequin.co.uk (8.8.4/8.7.3) with ESMTP id PAA02460; Tue, 4 Mar 1997 15:20:56 GMT Received: from [193.128.93.141] (dynamic-house2.long.harlequin.co.uk [193.128.93.141]) by propos.long.harlequin.co.uk (8.8.4/8.6.12) with ESMTP id PAA14265; Tue, 4 Mar 1997 15:20:21 GMT X-Sender: richard@mailhost.long.harlequin.co.uk Message-Id: In-Reply-To: <9703031909.AA28293@nova.netapp.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Tue, 4 Mar 1997 10:22:03 -0500 To: byron@netapp.com (Byron Rakitzis) From: Richard Brooksby Subject: Conceptual Integrity (Re: Update for Debian shells/rc-1.4-2) Cc: rc@hawkwind.utcs.toronto.edu, schwartz@cse.psu.edu Byron Rakitzis wrote: > That being said, I don't want to see rc unravel because of lack of > maintenance, and I would like to try to put together the fixes from the > last while and officially release it, so it gets picked up by the GNU > distrib and so on. I am more convinced than ever. Conceptual integrity is central to product quality. Having a system architect is the most important single step toward conceptual integrity... After teaching a software engineering laboratory more than 20 times, I came to insist that student teams as small as four people choose a manager, and a separate architect. -- Fred Brooks, The Mythical Man-Month (20th Anniversary Edition), 1995 Imo, someone needs to be in charge of rc, so that it doesn't get randomly hacked on by all and sundry. Letting it fly free with the other GNU tools is almost a guarantee of loss of conceptual integrity. As a long time user of rc I appreciate its quality, and would like to see quality maintained. Just voicing my concern. --- Richard Brooksby Leader, Manager, and Developer / Memory Management / Harlequin Tel. Int. +44 1954 785451 (voice) +44 1954 785444 (fax) From rc-owner Tue Mar 4 11:26:11 1997 Received: from kissimmee.infomkt.ibm.com ([204.146.129.20]) by hawkwind.utcs.utoronto.ca with SMTP id <24628>; Tue, 4 Mar 1997 11:23:50 -0500 Received: from dingler.dev.infomkt.ibm.com (dingler.dev.infomkt.ibm.com [204.146.132.31]) by kissimmee.infomkt.ibm.com (8.6.10/8.6.10) with ESMTP id LAA12697; Tue, 4 Mar 1997 11:18:34 -0500 Received: (from quanstro@localhost) by dingler.dev.infomkt.ibm.com (8.7.5/8.7.3) id LAA53946; Tue, 4 Mar 1997 11:20:28 -0500 Date: Tue, 4 Mar 1997 11:20:28 -0500 Message-Id: <199703041620.LAA53946@dingler.dev.infomkt.ibm.com> To: mkgardne@cs.uiuc.edu, rc@hawkwind.utcs.toronto.edu From: erik quanstrom >However, I find myself wanting to have an optional else-if clause in the if statement. huh? this is output from rc-1.4 on sgi ; if (true) { echo if } else if (false) { echo else if } else { echo else fallthrough } if ; if (false) { echo if } else if (false) { echo else if } else { echo else fallthrough } else fallthrough ; if (false) { echo if } else if (true) { echo else if } else { echo else fallthrough } else if From rc-owner Tue Mar 4 11:31:07 1997 Received: from pertsserver.cs.uiuc.edu ([128.174.247.69]) by hawkwind.utcs.utoronto.ca with SMTP id <24629>; Tue, 4 Mar 1997 11:29:04 -0500 Received: (from mkgardne@localhost) by pertsserver.cs.uiuc.edu (8.8.5/8.8.5) id KAA12776; Tue, 4 Mar 1997 10:28:45 -0600 (CST) Date: Tue, 4 Mar 1997 11:28:45 -0500 Message-Id: <199703041628.KAA12776@pertsserver.cs.uiuc.edu> From: "Mark K. Gardner" To: quanstro@Infomkt.ibm.com CC: rc@hawkwind.utcs.toronto.edu In-reply-to: <199703041620.LAA53946@dingler.dev.infomkt.ibm.com> (message from erik quanstrom on Tue, 4 Mar 1997 11:20:28 -0500) Subject: RE: if Suggestion Reply-to: mkgardne@cs.uiuc.edu OOPS! (He said as he wipes the egg off of his face.) I guess I had better avoid posting until I have had a chance to wake up. IF does indeed work as Erik says. No change necessary. -- Mark K. Gardner (mkgardne@cs.uiuc.edu) University of Illinois at Urbana-Champaign Real-Time Systems Laboratory -- From rc-owner Tue Mar 4 11:58:17 1997 Received: from weaver-gw.netapp.com ([198.95.224.2]) by hawkwind.utcs.utoronto.ca with SMTP id <24629>; Tue, 4 Mar 1997 11:57:07 -0500 Received: from netapp.com ([192.9.200.1]) by weaver.netapp.com with SMTP id <15850-5559>; Tue, 4 Mar 1997 08:56:56 -0000 Received: from nova.netapp.com by netapp.com (4.1/SMI-4.1) id AA04455; Tue, 4 Mar 97 08:57:54 PST Received: by nova.netapp.com (4.1/SMI-4.1) id AA05342; Tue, 4 Mar 97 08:57:52 PST Date: Tue, 4 Mar 1997 11:57:52 -0500 From: byron@netapp.com (Byron Rakitzis) Message-Id: <9703041657.AA05342@nova.netapp.com> To: rc@hawkwind.utcs.toronto.edu, richard@harlequin.co.uk Subject: Re: Conceptual Integrity (Re: Update for Debian shells/rc-1.4-2) Thanks for the nice citation. I didn't mean anything sinister by letting rc fly free with other GNU tools -- as far as I know, rc is *already* included on the GNU tapes and I just wanted to point out that it was time for a new version of rc to propagate through the free software distribution channels. I would love for someone to maintain rc, but given that no one has stepped up to the task in the last 3-4 years it's time for me to turn the crank once more. However, I absolutely cannot promise to continue to maintain rc even at this extremely low level of activity. Byron. From rc-owner Tue Mar 4 12:35:06 1997 Received: from techfac.TechFak.Uni-Bielefeld.DE ([129.70.132.100]) by hawkwind.utcs.utoronto.ca with SMTP id <24628>; Tue, 4 Mar 1997 12:33:26 -0500 Received: from lupine.TechFak.Uni-Bielefeld.DE by techfac.TechFak.Uni-Bielefeld.DE id AA23873; Tue, 4 Mar 1997 18:33:12 +0100 Received: by lupine.techfak.uni-bielefeld.de (5.x/tp.29.0890) id AA00778; Tue, 4 Mar 1997 18:33:11 +0100 Message-Id: <9703041733.AA00778@lupine.techfak.uni-bielefeld.de> To: rc@hawkwind.utcs.toronto.edu Subject: Re: Update for Debian shells/rc-1.4-2 In-Reply-To: Byron's message of "Mon, 03 Mar 1997 14:09:32 EST." <9703031909.AA28293@nova.netapp.com> X-Organization: Uni Bielefeld, Technische Fakultaet X-Phone: +49 521 106 2902 Date: Tue, 4 Mar 1997 12:33:09 -0500 From: Peter Koch -----BEGIN PGP SIGNED MESSAGE----- > Given that I am stuck on my own with nothing but BSD on my pc, I will > have to ask for some volunteers to run trip tests. I'll mention it > again on the list once I get my act together so I can incorporate > these patches. "rc" is used here as default shell for our students - mainly on Solaris, but also on SGI Irix and Digital Unix. Most of them (actually > 400 ) never change to "*sh", so "rc" "proves" to be sufficient. Well, our yppasswd won't allow you to alter your login shell if the name starts with "r", but that's another story. Version 1.5beta was ported to Solaris (2.4) long ago, fixing some ugly problems with signal handling. We also started POSIXifying the code, but there is still some more work to do. We are not that interested in any new features, but we'd like to share our modifications with the community and see a finalized version of "rc" which compiles quietly and runs on (at least) standard UNIX systems. - -Peter -----BEGIN PGP SIGNATURE----- Version: 2.6.3i Charset: ascii iQCVAgUBMxxcuxePjvYGi6TZAQHEUAP+OXv/Ybay8obqDb5CYzTBfBYVy6JNy2tT M1/5cOMcf5C2NmaQs6XkXrW9yQBC4VJl030NhVJoQFRGrmYGTk0cl/TTsjmkIbfj yerIx6bVjWOnKwccJWjl5+w4hsvkjAA3pOKyWFNuuUmM3g/moz3cbJ0v+qObbMdj OromKUT9y1Q= =iC+x -----END PGP SIGNATURE----- From rc-owner Tue Mar 4 13:57:12 1997 Received: from cse.psu.edu ([130.203.3.50]) by hawkwind.utcs.utoronto.ca with SMTP id <24628>; Tue, 4 Mar 1997 13:56:35 -0500 Received: from basic.cse.psu.edu (schwartz@basic.cse.psu.edu [130.203.10.12]) by cse.psu.edu (8.8.5/8.7.3) with ESMTP id NAA22547; Tue, 4 Mar 1997 13:56:20 -0500 (EST) Message-Id: <199703041856.NAA22547@cse.psu.edu> To: mkgardne@cs.uiuc.edu cc: rc@hawkwind.utcs.toronto.edu, byron@netapp.com Subject: Re: Helping with RC In-reply-to: Your message of "Tue, 04 Mar 1997 09:46:58 EST." <199703041446.IAA09487@pertsserver.cs.uiuc.edu> Date: Tue, 4 Mar 1997 13:56:15 -0500 From: Scott Schwartz "Mark K. Gardner" writes: | I volunteer to test the Solaris version of RC. Me too. And SunOS. From rc-owner Tue Mar 4 14:08:43 1997 Received: from cse.psu.edu ([130.203.3.50]) by hawkwind.utcs.utoronto.ca with SMTP id <24628>; Tue, 4 Mar 1997 14:08:19 -0500 Received: from basic.cse.psu.edu (schwartz@basic.cse.psu.edu [130.203.10.12]) by cse.psu.edu (8.8.5/8.7.3) with ESMTP id OAA22774 for ; Tue, 4 Mar 1997 14:08:14 -0500 (EST) Message-Id: <199703041908.OAA22774@cse.psu.edu> To: rc@hawkwind.utcs.toronto.edu Subject: Re: Update for Debian shells/rc-1.4-2 In-reply-to: Your message of "Tue, 04 Mar 1997 12:33:09 EST." <9703041733.AA00778@lupine.techfak.uni-bielefeld.de> Date: Tue, 4 Mar 1997 14:08:09 -0500 From: Scott Schwartz Peter Koch writes: | Version 1.5beta was ported to Solaris (2.4) long ago, fixing some ugly | problems with signal handling. Aside from the SIGCLD thing and the SIGINT thing, what problems? | We also started POSIXifying the code, Posix systems still run traditional code, but not the other way around. To avoid bunches of ifdefs, that argues for staying with the traditional code as much as possible. From rc-owner Tue Mar 4 15:12:42 1997 Received: from kissimmee.infomkt.ibm.com ([204.146.129.20]) by hawkwind.utcs.utoronto.ca with SMTP id <24628>; Tue, 4 Mar 1997 15:12:08 -0500 Received: from dingler.dev.infomkt.ibm.com (dingler.dev.infomkt.ibm.com [204.146.132.31]) by kissimmee.infomkt.ibm.com (8.6.10/8.6.10) with ESMTP id PAA05170 for ; Tue, 4 Mar 1997 15:06:21 -0500 Received: from d2.dev.infomkt.ibm.com (d2.dev.infomkt.ibm.com [204.146.132.23]) by dingler.dev.infomkt.ibm.com (8.7.5/8.7.3) with ESMTP id PAA53342 for ; Tue, 4 Mar 1997 15:11:24 -0500 Received: (from quanstro@localhost) by d2.dev.infomkt.ibm.com (8.7.5/8.7.3) id UAA47972 for rc@hawkwind.utcs.toronto.edu; Tue, 4 Mar 1997 20:09:58 GMT Date: Tue, 4 Mar 1997 15:09:58 -0500 Message-Id: <199703042009.UAA47972@d2.dev.infomkt.ibm.com> To: rc@hawkwind.utcs.toronto.edu From: erik quanstrom Subject: rc maintence i'll volunteer to maintain rc. i'd like to see One True Version of rc appear again. & i'd like to see some of these pesky portibility problems go away. we have a pretty good setup here for running trip.rc, with at least the following architectures available: aix 4.1.4 aix 4.2 aix 3.2.5 solaris 2.5 linux 2.something hp/ux 9.0.5 hp/ux 10.something irix 5.4 erik From rc-owner Tue Mar 4 18:27:27 1997 Received: from cs.adfa.oz.au ([131.236.21.158]) by hawkwind.utcs.utoronto.ca with SMTP id <24628>; Tue, 4 Mar 1997 18:26:59 -0500 Received: (from wkt@localhost) by cs.adfa.oz.au (8.7.5/8.7.3) id KAA02469; Wed, 5 Mar 1997 10:29:02 +1100 (EST) From: Warren Toomey Message-Id: <199703042329.KAA02469@cs.adfa.oz.au> Subject: Re: rc maintence To: quanstro@Infomkt.ibm.com (erik quanstrom) Date: Tue, 4 Mar 1997 18:29:02 -0500 Cc: rc@hawkwind.utcs.toronto.edu In-Reply-To: <199703042009.UAA47972@d2.dev.infomkt.ibm.com> from erik quanstrom at "Mar 4, 97 03:09:58 pm" X-Mailer: ELM [version 2.4ME+ PL22 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit In atricle by erik quanstrom: > i'll volunteer to maintain rc. > > i'd like to see One True Version of rc appear > again. & i'd like to see some of these pesky > portibility problems go away. > > we have a pretty good setup here for running > trip.rc, with at least the following architectures > available: > > aix 4.1.4 > aix 4.2 > aix 3.2.5 > solaris 2.5 > linux 2.something > hp/ux 9.0.5 > hp/ux 10.something > irix 5.4 > > erik I've got rc running on FreeBSD 2.x and Minix 2.0 (the 16-bit PC version!) I'd be happy to test out new versions of rc for these systems. Ciao, Warren Toomey wkt@cs.adfa.oz.au From rc-owner Tue Mar 4 21:28:40 1997 Received: from elysium.uwa.edu.au ([130.95.128.2]) by hawkwind.utcs.utoronto.ca with SMTP id <24628>; Tue, 4 Mar 1997 21:28:12 -0500 Received: from typhaon.ucs.uwa.edu.au (luyer@typhaon.ucs.uwa.edu.au [130.95.128.64]) by elysium.uwa.edu.au (8.8.2/8.8.0) with SMTP id KAA17233; Wed, 5 Mar 1997 10:27:50 +0800 (WST) Date: Tue, 4 Mar 1997 21:28:14 -0500 From: David Luyer To: erik quanstrom cc: rc@hawkwind.utcs.toronto.edu Subject: Re: rc maintence In-Reply-To: <199703042329.KAA02469@cs.adfa.oz.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Tue, 4 Mar 1997, Warren Toomey wrote: >> i'll volunteer to maintain rc. >> >> i'd like to see One True Version of rc appear >> again. & i'd like to see some of these pesky >> portibility problems go away. >> >> we have a pretty good setup here for running >> trip.rc, with at least the following architectures >> available: >> >> aix 4.1.4 >> aix 4.2 >> aix 3.2.5 >> solaris 2.5 >> linux 2.something >> hp/ux 9.0.5 >> hp/ux 10.something >> irix 5.4 >> >> erik > >I've got rc running on FreeBSD 2.x and Minix 2.0 (the 16-bit PC version!) >I'd be happy to test out new versions of rc for these systems. I'm using rc on: NetBSD Linux Digital Unix Solaris SunOS 4.1.1, 4.1.3U1 StarOS 4.1.1 SCO (but I have no compiler to test stuff there) Ultrix I also have avaliable machines running NeXTStep, Irix and VSTa that I haven't tried rc on. And there are probably other unix OS's around that I use but can't think of right now. I'd be happy to test rc on any of these OS's that you can't find other testers for. David. From rc-owner Wed Mar 5 00:56:26 1997 Received: from mail.clark.net ([168.143.0.10]) by hawkwind.utcs.utoronto.ca with SMTP id <24628>; Wed, 5 Mar 1997 00:55:56 -0500 Received: from explorer2.clark.net (culliton@explorer2.clark.net [168.143.0.5]) by mail.clark.net (8.8.5/8.6.5) with ESMTP id AAA15859 for ; Wed, 5 Mar 1997 00:55:39 -0500 (EST) From: Tom Culliton Received: (from culliton@localhost) by explorer2.clark.net (8.8.5/8.7.1) id AAA13494 for rc@hawkwind.utcs.toronto.edu; Wed, 5 Mar 1997 00:55:45 -0500 (EST) Date: Wed, 5 Mar 1997 00:55:45 -0500 Message-Id: <199703050555.AAA13494@explorer2.clark.net> To: rc@hawkwind.utcs.toronto.edu Subject: rc, signals, readline, and Linux 8-) 8-) 8-) Anybody who has been paying attention will know that I've been fighting a battle with the combination mentioned above. Both rc and readline like to play with signals, readline always acts like a slow system call when the signal hanlder returns, and leaves things FUBAR'ed if it doesn't. 8-) 8-) 8-) So my big **** eating grin might tell you something. 8-) Thats right, unless I've overlooked something really dumb, it's fixed!!! This fix probably applies to anyone using readline, especially on Posix type systems. Basically it entails ALWAYS treating readline as a slow system call, retrying the read on EINTR, and doing some deep secret readline magic in the rc signal catcher. I'll try to post a context diff against virgin rc-1.5betadev-1 as soon as I make a few posix-isms conditional. Tom (one very tired and happy hacker) From rc-owner Wed Mar 5 22:10:50 1997 Received: from mail.clark.net ([168.143.0.10]) by hawkwind.utcs.utoronto.ca with SMTP id <24628>; Wed, 5 Mar 1997 22:09:30 -0500 Received: from clark.net (culliton@explorer.clark.net [168.143.0.7]) by mail.clark.net (8.8.5/8.6.5) with ESMTP id WAA10865; Wed, 5 Mar 1997 22:08:30 -0500 (EST) From: Tom Culliton Received: (from culliton@localhost) by clark.net (8.8.5/8.7.1) id WAA06759; Wed, 5 Mar 1997 22:08:49 -0500 (EST) Date: Wed, 5 Mar 1997 22:08:49 -0500 Message-Id: <199703060308.WAA06759@clark.net> To: byron@netapp.com, rc@hawkwind.utcs.toronto.edu Subject: My patches for Linux, readline and signals (1 of 2) (This is the first of two parts. The first are my patches against rc-1.5betadev-1, which are a collection of "fix only" patches from the mailing list and my own work. The second is my Linux configuration, which should also be generally useful for using readline and building on Posix systems. So without further ado...) diff -rc rc-1.5betadev-1/builtins.c rc-1.5tjc/builtins.c *** rc-1.5betadev-1/builtins.c Sun Mar 6 22:32:49 1994 --- rc-1.5tjc/builtins.c Wed Mar 5 21:02:10 1997 *************** *** 8,14 **** */ #include - #include #include #include "rc.h" #include "jbwrap.h" --- 8,13 ---- *************** *** 72,78 **** Jbwrap j; Estack e1, e2; Edata jreturn, star; ! if (setjmp(j.j)) return; starassign(*av, av+1, TRUE); jreturn.jb = &j; --- 71,77 ---- Jbwrap j; Estack e1, e2; Edata jreturn, star; ! if (rc_setjmp(j.j)) return; starassign(*av, av+1, TRUE); jreturn.jb = &j; diff -rc rc-1.5betadev-1/except.c rc-1.5tjc/except.c *** rc-1.5betadev-1/except.c Sun Mar 6 22:32:50 1994 --- rc-1.5tjc/except.c Wed Mar 5 20:38:33 1997 *************** *** 1,4 **** - #include #include #include "rc.h" #include "jbwrap.h" --- 1,3 ---- *************** *** 91,97 **** interactive = estack->interactive; estack = estack->prev; ! longjmp(j->j, 1); } } rc_exit(1); /* top of exception stack */ --- 90,96 ---- interactive = estack->interactive; estack = estack->prev; ! rc_longjmp(j->j, 1); } } rc_exit(1); /* top of exception stack */ diff -rc rc-1.5betadev-1/exec.c rc-1.5tjc/exec.c *** rc-1.5betadev-1/exec.c Sun Mar 6 22:32:52 1994 --- rc-1.5tjc/exec.c Wed Mar 5 20:39:26 1997 *************** *** 1,9 **** /* exec.c */ #include #include - #include #include "rc.h" - #include "jbwrap.h" /* Takes an argument list and does the appropriate thing (calls a --- 1,7 ---- diff -rc rc-1.5betadev-1/input.c rc-1.5tjc/input.c *** rc-1.5betadev-1/input.c Sun Mar 6 22:33:03 1994 --- rc-1.5tjc/input.c Wed Mar 5 21:02:23 1997 *************** *** 1,7 **** /* input.c: i/o routines for files and pseudo-files (strings) */ #include - #include #include "rc.h" #include "jbwrap.h" --- 1,6 ---- *************** *** 88,114 **** /* signal-safe readline wrapper */ #ifdef READLINE ! #ifndef SVSIGS static char *rc_readline(char *prompt) { char *r; interrupt_happened = FALSE; ! if (!setjmp(slowbuf.j)) { slow = TRUE; if (!interrupt_happened) r = readline(prompt); ! else r = NULL; ! } else r = NULL; - slow = FALSE; - if (r == NULL) errno = EINTR; sigchk(); return r; } #else #define rc_readline readline - #endif /* SVSIGS */ #endif /* READLINE */ /* --- 87,119 ---- /* signal-safe readline wrapper */ #ifdef READLINE ! int in_readline = 0; /* a flag for readline clean up */ ! static char *rc_readline(char *prompt) { char *r; interrupt_happened = FALSE; ! if (!rc_setjmp(slowbuf.j)) { slow = TRUE; if (!interrupt_happened) + { + errno = 0; /* this is relatively evil */ + in_readline = TRUE; r = readline(prompt); ! in_readline = FALSE; ! } else { r = NULL; ! errno = EINTR; ! } ! } else { r = NULL; errno = EINTR; + } + slow = FALSE; sigchk(); return r; } #else #define rc_readline readline #endif /* READLINE */ /* *************** *** 121,128 **** while (1) { #ifdef READLINE if (interactive && istack->fd == 0) { ! rlinebuf = readline(prompt); if (rlinebuf == NULL) { chars_in = 0; } else { if (*rlinebuf != '\0') --- 126,135 ---- while (1) { #ifdef READLINE if (interactive && istack->fd == 0) { ! rlinebuf = rc_readline(prompt); if (rlinebuf == NULL) { + if (errno == EINTR) + continue; chars_in = 0; } else { if (*rlinebuf != '\0') *************** *** 140,145 **** --- 147,154 ---- long /*ssize_t*/ r = rc_read(istack->fd, inbuf + 2, BUFSIZE); sigchk(); if (r < 0) { + if (errno == EINTR) + continue; uerror("read"); rc_exit(1); } *************** *** 255,261 **** Edata jerror; if (dashen) execit = FALSE; ! setjmp(j.j); jerror.jb = &j; except(eError, jerror, &e1); for (eof = FALSE; !eof;) { --- 264,270 ---- Edata jerror; if (dashen) execit = FALSE; ! rc_setjmp(j.j); jerror.jb = &j; except(eError, jerror, &e1); for (eof = FALSE; !eof;) { *************** *** 279,288 **** } if ((s = varlookup("prompt")) != NULL) { #ifdef READLINE ! prompt = s->w; ! #else ! fprint(2, "%s", s->w); #endif prompt2 = (s->n == NULL ? "" : s->n->w); } } --- 288,298 ---- } if ((s = varlookup("prompt")) != NULL) { #ifdef READLINE ! if (istack->fd == 0) ! prompt = s->w; ! else #endif + fprint(2, "%s", s->w); prompt2 = (s->n == NULL ? "" : s->n->w); } } *************** *** 301,306 **** --- 311,329 ---- popinput(); unexcept(); /* eError */ return parsetree; + } + + extern void print_prompt2() { + lineno++; + if (interactive) + { + #ifdef READLINE + if (istack->fd == 0) + prompt = prompt2; + else + #endif + fprint(2, "%s", prompt2); + } } /* parse a function imported from the environment */ diff -rc rc-1.5betadev-1/jbwrap.h rc-1.5tjc/jbwrap.h *** rc-1.5betadev-1/jbwrap.h Thu Dec 19 15:10:03 1991 --- rc-1.5tjc/jbwrap.h Wed Mar 5 21:04:42 1997 *************** *** 1,10 **** /* certain braindamaged environments don't define jmp_buf as an array, so... */ struct Jbwrap { jmp_buf j; }; - extern Jbwrap slowbuf; /* for getting out of interrupts while performing slow i/o on BSD */ - extern int setjmp(jmp_buf); extern void longjmp(jmp_buf, int); --- 1,33 ---- /* certain braindamaged environments don't define jmp_buf as an array, so... */ + #include + #include "config.h" + + #ifndef USESIGSETJMP + struct Jbwrap { jmp_buf j; }; extern int setjmp(jmp_buf); extern void longjmp(jmp_buf, int); + + #define rc_setjmp(a) setjmp(a) + #define rc_longjmp(a, b) longjmp(a, b) + + #else + + struct Jbwrap { + sigjmp_buf j; + }; + + /* extern int sigsetjmp(sigjmp_buf, int); */ + /* extern void siglongjmp(sigjmp_buf, int); */ + + #define rc_setjmp(a) sigsetjmp(a, 1) + #define rc_longjmp(a, b) siglongjmp(a, b) + + #endif + + extern Jbwrap slowbuf; /* for getting out of interrupts while performing slow i/o on BSD */ + diff -rc rc-1.5betadev-1/lex.c rc-1.5tjc/lex.c *** rc-1.5betadev-1/lex.c Sun Mar 6 22:33:05 1994 --- rc-1.5tjc/lex.c Sat Feb 22 21:58:54 1997 *************** *** 336,351 **** realbuf = ealloc(bufsize); } - extern void print_prompt2() { - lineno++; - #ifdef READLINE - prompt = prompt2; - #else - if (interactive) - fprint(2, "%s", prompt2); - #endif - } - /* Scan in a pair of integers for redirections like >[2=1]. CLOSED represents a closed file descriptor (i.e., >[2=]) and UNSET represents an undesignated file descriptor (e.g., --- 336,341 ---- diff -rc rc-1.5betadev-1/print.c rc-1.5tjc/print.c *** rc-1.5betadev-1/print.c Sun Mar 6 22:33:10 1994 --- rc-1.5tjc/print.c Wed Mar 5 21:11:13 1997 *************** *** 1,7 **** /* print.c -- formatted printing routines (Paul Haahr, 12/91) */ #include "rc.h" ! #include #define PRINT_ALLOCSIZE ((SIZE_T)64) #define SPRINT_BUFSIZ ((SIZE_T)1024) --- 1,7 ---- /* print.c -- formatted printing routines (Paul Haahr, 12/91) */ #include "rc.h" ! #include "jbwrap.h" #define PRINT_ALLOCSIZE ((SIZE_T)64) #define SPRINT_BUFSIZ ((SIZE_T)1024) *************** *** 411,425 **** } static void snprint_grow(Format *format, SIZE_T more) { ! longjmp(format->u.p, 1); } extern int snprint(char *buf, int buflen, const char *fmt,...) { int n; ! jmp_buf jbuf; Format format; ! if (setjmp(jbuf)) { *format.buf = '\0'; return format.buf - format.bufbegin; } --- 411,425 ---- } static void snprint_grow(Format *format, SIZE_T more) { ! rc_longjmp(format->u.p, 1); } extern int snprint(char *buf, int buflen, const char *fmt,...) { int n; ! Jbwrap jbuf; Format format; ! if (rc_setjmp(jbuf.j)) { *format.buf = '\0'; return format.buf - format.bufbegin; } *************** *** 429,435 **** format.bufend = buf + buflen - 1; format.grow = snprint_grow; format.flushed = 0; ! format.u.p = jbuf; va_start(format.args, fmt); n = printfmt(&format, fmt); --- 429,435 ---- format.bufend = buf + buflen - 1; format.grow = snprint_grow; format.flushed = 0; ! format.u.p = jbuf.j; va_start(format.args, fmt); n = printfmt(&format, fmt); *************** *** 441,450 **** extern int sprint(char *buf, const char *fmt,...) { int n; ! jmp_buf jbuf; Format format; ! if (setjmp(jbuf)) { *format.buf = '\0'; return format.buf - format.bufbegin; } --- 441,450 ---- extern int sprint(char *buf, const char *fmt,...) { int n; ! Jbwrap jbuf; Format format; ! if (rc_setjmp(jbuf.j)) { *format.buf = '\0'; return format.buf - format.bufbegin; } *************** *** 454,460 **** format.bufend = buf + SPRINT_BUFSIZ - 1; format.grow = snprint_grow; format.flushed = 0; ! format.u.p = jbuf; va_start(format.args, fmt); n = printfmt(&format, fmt); --- 454,460 ---- format.bufend = buf + SPRINT_BUFSIZ - 1; format.grow = snprint_grow; format.flushed = 0; ! format.u.p = jbuf.j; va_start(format.args, fmt); n = printfmt(&format, fmt); diff -rc rc-1.5betadev-1/signal.c rc-1.5tjc/signal.c *** rc-1.5betadev-1/signal.c Sun Mar 6 22:33:16 1994 --- rc-1.5tjc/signal.c Wed Mar 5 21:45:51 1997 *************** *** 1,7 **** /* signal.c: a Hugh-approved signal handler. */ #include - #include #include "rc.h" #include "sigmsgs.h" #include "jbwrap.h" --- 1,6 ---- *************** *** 12,17 **** --- 11,34 ---- static volatile SIG_ATOMIC_T sigcount, caught[NUMOFSIGNALS]; + /* + The situation with readline is fairly hairy... It tries to catch SIGINT, + SIGALRM SIGTSTP, SIGTTOU SIGTTIN, SIGCONT and SIGWINCH. The SIGWINCH + handler in readline assumes Berkley semantics and doesn't reset itself, + it also tries to daisy chain to the "old" signal handler (in this case + rc's catcher()), which will do lord only knows what, without cleaning up + the terminal settings. The rest of the signals readline catches seem to + be well behaved. However for any signal that readline doesn't catch, + the terminal is never reset! + + Also for any caught signal, unless you treat it as a slow "system call" + and longjmp out of the signal handler, rc ignores it and resumes the + read. This means that SIGINT does not abort input like it's supposed + to. The way I've got it set up, all signals abort readline input and + clean up after themselves. I'm willing to entertain discussions on more + "proper" behaviour, but for now this is simple and predictable. ;-) + */ + extern void catcher(int s) { if (caught[s] == 0) { sigcount++; *************** *** 19,27 **** } signal(s, catcher); interrupt_happened = TRUE; ! #ifndef SVSIGS ! if (slow) ! longjmp(slowbuf.j, 1); #endif } --- 36,70 ---- } signal(s, catcher); interrupt_happened = TRUE; ! #if defined(SVSIGS) || defined(READLINE) ! if (slow) { ! #if defined(READLINE) ! /* It's very important that readline is always */ ! /* treated as a slow system call! */ ! extern int rl_pending_input; ! extern int in_readline; ! if (in_readline) { ! in_readline = FALSE; /* Not any more!!! */ ! switch (s) { ! default: ! rl_clean_up_for_exit(); ! rl_deprep_terminal(); ! rl_clear_signals(); /* this should be OK */ ! rl_pending_input = 0; ! /* readline already cleans up for these */ ! case SIGINT: ! case SIGALRM: ! #if defined(SIGTSTP) ! case SIGTSTP: ! case SIGTTOU: ! case SIGTTIN: ! break; ! #endif ! } ! } ! #endif ! rc_longjmp(slowbuf.j, 1); ! } #endif } *************** *** 66,72 **** void (*h)(int); int i; for (i = 1; i < NUMOFSIGNALS; i++) { ! if ((h = signal(i, SIG_DFL)) != SIG_DFL) signal(i, h); sighandlers[i] = h; } --- 109,115 ---- void (*h)(int); int i; for (i = 1; i < NUMOFSIGNALS; i++) { ! if ((h = signal(i, SIG_DFL)) != SIG_DFL && h != SIG_ERR) signal(i, h); sighandlers[i] = h; } diff -rc rc-1.5betadev-1/utils.c rc-1.5tjc/utils.c *** rc-1.5betadev-1/utils.c Sun Mar 6 22:33:19 1994 --- rc-1.5tjc/utils.c Wed Mar 5 21:00:21 1997 *************** *** 1,7 **** /* utils.c: functions of general utility */ #include - #include #include "rc.h" #include "jbwrap.h" --- 1,6 ---- *************** *** 71,77 **** int i; for (i = 0; remain > 0; buf += i, remain -= i) { interrupt_happened = FALSE; ! if (!setjmp(slowbuf.j)) { slow = TRUE; if (interrupt_happened) break; --- 70,76 ---- int i; for (i = 0; remain > 0; buf += i, remain -= i) { interrupt_happened = FALSE; ! if (!rc_setjmp(slowbuf.j)) { slow = TRUE; if (interrupt_happened) break; *************** *** 88,94 **** extern int rc_read(int fd, char *buf, SIZE_T n) { long /*ssize_t*/ r; interrupt_happened = FALSE; ! if (!setjmp(slowbuf.j)) { slow = TRUE; if (!interrupt_happened) r = read(fd, buf, n); --- 87,93 ---- extern int rc_read(int fd, char *buf, SIZE_T n) { long /*ssize_t*/ r; interrupt_happened = FALSE; ! if (!rc_setjmp(slowbuf.j)) { slow = TRUE; if (!interrupt_happened) r = read(fd, buf, n); diff -rc rc-1.5betadev-1/wait.c rc-1.5tjc/wait.c *** rc-1.5betadev-1/wait.c Sun Mar 6 22:33:23 1994 --- rc-1.5tjc/wait.c Wed Mar 5 21:00:29 1997 *************** *** 1,5 **** #include - #include #include "rc.h" #include "jbwrap.h" --- 1,4 ---- *************** *** 112,118 **** static int rc_wait(int *stat) { int r; interrupt_happened = FALSE; ! if (!setjmp(slowbuf.j)) { slow = TRUE; if (!interrupt_happened) r = wait(stat); --- 111,117 ---- static int rc_wait(int *stat) { int r; interrupt_happened = FALSE; ! if (!rc_setjmp(slowbuf.j)) { slow = TRUE; if (!interrupt_happened) r = wait(stat); diff -rc rc-1.5betadev-1/walk.c rc-1.5tjc/walk.c *** rc-1.5betadev-1/walk.c Sun Mar 6 22:33:26 1994 --- rc-1.5tjc/walk.c Wed Mar 5 21:00:40 1997 *************** *** 1,7 **** /* walk.c: walks the parse tree. */ #include - #include #include "rc.h" #include "jbwrap.h" --- 1,6 ---- *************** *** 108,114 **** cond = oldcond; break; } ! if (setjmp(j.j)) break; jbreak.jb = &j; except(eBreak, jbreak, &e1); --- 107,113 ---- cond = oldcond; break; } ! if (rc_setjmp(j.j)) break; jbreak.jb = &j; except(eBreak, jbreak, &e1); *************** *** 131,137 **** Jbwrap j; Estack e1, e2; Edata jbreak; ! if (setjmp(j.j)) break; jbreak.jb = &j; except(eBreak, jbreak, &e1); --- 130,136 ---- Jbwrap j; Estack e1, e2; Edata jbreak; ! if (rc_setjmp(j.j)) break; jbreak.jb = &j; except(eBreak, jbreak, &e1); From rc-owner Wed Mar 5 22:11:08 1997 Received: from mail.clark.net ([168.143.0.10]) by hawkwind.utcs.utoronto.ca with SMTP id <24629>; Wed, 5 Mar 1997 22:10:57 -0500 Received: from clark.net (culliton@explorer.clark.net [168.143.0.7]) by mail.clark.net (8.8.5/8.6.5) with ESMTP id WAA11303; Wed, 5 Mar 1997 22:09:46 -0500 (EST) From: Tom Culliton Received: (from culliton@localhost) by clark.net (8.8.5/8.7.1) id WAA06909; Wed, 5 Mar 1997 22:10:02 -0500 (EST) Date: Wed, 5 Mar 1997 22:10:02 -0500 Message-Id: <199703060310.WAA06909@clark.net> To: byron@netapp.com, rc@hawkwind.utcs.toronto.edu Subject: My patches for Linux, readline and signals (2 of 2) (This is the second of two parts. The first are my patches against rc-1.5betadev-1, which are a collection of "fix only" patches from the mailing list and my own work. The second is my Linux configuration, which should also be generally useful for using readline and building on Posix systems. So without further ado...) *** rc-1.5betadev-1/config.h-dist Mon May 25 14:12:57 1992 --- rc-1.5tjc/config.h Wed Mar 5 21:25:46 1997 *************** *** 6,13 **** * system matches one of them; you can search for the beginning of the * defaults section by looking for the string "#ifndef CUSTOM"). If you * want to override the suggested defaults, define the macro CUSTOM. - #define CUSTOM */ /* * (Note that certain default settings redefine this macro) --- 6,13 ---- * system matches one of them; you can search for the beginning of the * defaults section by looking for the string "#ifndef CUSTOM"). If you * want to override the suggested defaults, define the macro CUSTOM. */ + #define CUSTOM /* * (Note that certain default settings redefine this macro) *************** *** 16,22 **** * something sensible for your system if you don't like the path shown * below. */ ! #define DEFAULTPATH "/usr/ucb", "/usr/bin", "/bin", "." /* * Define the macro NODIRENT if your system has but not --- 16,22 ---- * something sensible for your system if you don't like the path shown * below. */ ! #define DEFAULTPATH "/usr/local/bin", "/usr/bin", "/bin", "." /* * Define the macro NODIRENT if your system has but not *************** *** 30,37 **** * after returning from an interrupt handler. (If you are not sure what * this means, see the man page for signal(2). In any case, it is probably * safe to leave this macro undefined.) - #define SVSIGS */ /* * Define the macro NOCMDARG if you do not have /dev/fd or fifos on your --- 30,37 ---- * after returning from an interrupt handler. (If you are not sure what * this means, see the man page for signal(2). In any case, it is probably * safe to leave this macro undefined.) */ + #define SVSIGS /* * Define the macro NOCMDARG if you do not have /dev/fd or fifos on your *************** *** 60,73 **** /* * Define the macro NOSIGCLD if your system uses SIGCLD in the System * V way. (e.g., sgi's Irix) - #define NOSIGCLD */ /* * Define the macro READLINE if you want rc to call GNU readline * instead of read(2) on interactive shells. - #define READLINE */ /* * Define the macro NOEXECVE if your Unix does not interpret #! in the --- 60,73 ---- /* * Define the macro NOSIGCLD if your system uses SIGCLD in the System * V way. (e.g., sgi's Irix) */ + #define NOSIGCLD /* * Define the macro READLINE if you want rc to call GNU readline * instead of read(2) on interactive shells. */ + #define READLINE /* * Define the macro NOEXECVE if your Unix does not interpret #! in the *************** *** 78,85 **** /* * If you want rc to default to some interpreter for files which don't * have a legal #! on the first line, define the macro DEFAULTINTERP. - #define DEFAULTINTERP "/bin/sh" */ /* * If your /bin/sh (or another program you care about) rejects environment --- 78,85 ---- /* * If you want rc to default to some interpreter for files which don't * have a legal #! on the first line, define the macro DEFAULTINTERP. */ + #define DEFAULTINTERP "/bin/sh" /* * If your /bin/sh (or another program you care about) rejects environment *************** *** 88,95 **** * define PROTECT_ENV for this hack. (Known offenders: every sh I have tried; * SunOS (silently discards), NeXT (aborts with error), SGI (aborts with * error), Ultrix (sh seems to work, sh5 aborts with error)) - #define PROTECT_ENV */ /* * Define the macro NOECHO if you wish to omit rc's echo builtin from the --- 88,95 ---- * define PROTECT_ENV for this hack. (Known offenders: every sh I have tried; * SunOS (silently discards), NeXT (aborts with error), SGI (aborts with * error), Ultrix (sh seems to work, sh5 aborts with error)) */ + #define PROTECT_ENV /* * Define the macro NOECHO if you wish to omit rc's echo builtin from the *** rc-1.5betadev-1/Makefile Sun Mar 6 22:32:46 1994 --- rc-1.5tjc/makefile Wed Mar 5 21:26:00 1997 *************** *** 16,28 **** #ADDON=addon.o # Use an ANSI compiler (or at least one that groks prototypes and void *): ! CC=gcc -g -O ! CFLAGS= ! LDFLAGS= # You may substitute "bison -y" for yacc. (You want to choose the one that # makes a smaller y.tab.c. Also see the README about Sun's yacc.) ! YACC=yacc OBJS=$(ADDON) builtins.o except.o exec.o $(EXECVE) fn.o footobar.o getopt.o \ glob.o glom.o hash.o heredoc.o input.o lex.o list.o main.o match.o \ --- 16,30 ---- #ADDON=addon.o # Use an ANSI compiler (or at least one that groks prototypes and void *): ! CC=gcc ! CFLAGS=-Wall -O2 -fomit-frame-pointer -funroll-loops -DSYSVR4 -DUSESIGSETJMP ! #CFLAGS=-Wall -g -fomit-frame-pointer -funroll-loops -DSYSVR4 -DUSESIGSETJMP ! LDFLAGS=-s -static -lreadline -ltermcap ! #LDFLAGS= -static -lreadline -ltermcap # You may substitute "bison -y" for yacc. (You want to choose the one that # makes a smaller y.tab.c. Also see the README about Sun's yacc.) ! YACC=bison -y OBJS=$(ADDON) builtins.o except.o exec.o $(EXECVE) fn.o footobar.o getopt.o \ glob.o glom.o hash.o heredoc.o input.o lex.o list.o main.o match.o \ *************** *** 38,44 **** $(CC) -o $@ $(OBJS) $(LDFLAGS) sigmsgs.c: mksignal ! sh mksignal /usr/include/sys/signal.h y.tab.c: parse.y $(YACC) -d parse.y --- 40,46 ---- $(CC) -o $@ $(OBJS) $(LDFLAGS) sigmsgs.c: mksignal ! sh mksignal /usr/include/asm/signal.h y.tab.c: parse.y $(YACC) -d parse.y *************** *** 50,56 **** ./rc -p < trip.rc clean: force ! rm -f *.o *.tab.* sigmsgs.* history: force cd history; make CC="$(CC)" $(HISTORYMAKEFLAGS) --- 52,58 ---- ./rc -p < trip.rc clean: force ! rm -f *.o *.tab.* sigmsgs.* core history: force cd history; make CC="$(CC)" $(HISTORYMAKEFLAGS) From rc-owner Thu Mar 6 03:25:38 1997 Received: from janus.ocegr.fr ([194.3.183.34]) by hawkwind.utcs.utoronto.ca with SMTP id <24628>; Thu, 6 Mar 1997 03:25:13 -0500 Received: (qmail 3703 invoked from network); 6 Mar 1997 08:24:32 -0000 Received: from hydra.ocegr.fr (HELO ocegr.fr) (134.188.135.3) by janus.ocegr.fr with SMTP; 6 Mar 1997 08:24:32 -0000 Received: from beryl by ocegr.fr (5.0/SMI-SVR4) id AA05576; Thu, 6 Mar 1997 09:25:16 +0100 Message-Id: <9703060825.AA05576@ocegr.fr> Comments: Authenticated sender is From: "Gert-Jan Vons" To: rc@hawkwind.utcs.toronto.edu Date: Thu, 6 Mar 1997 03:21:10 -0500 Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT Subject: RC help/question/... Reply-To: Gert-Jan.Vons@ocegr.fr Priority: normal X-Mailer: Pegasus Mail for Win32 (v2.53) content-length: 1294 Hello all, good to see this list is still alive, it's the only place where I encounter other rc users :) A couple of things: - Concerning Byron's offer to get 1.5 out of the door, I can help testing under SCO Openserver, FreeBSD 2.1.x, Solaris 1 and 2. I'd sure like to have a single rc package, without the need to grab different patches from various sources. An autoconf script would be nice as well, shouldn't be too difficult. - Also, there have been some mails recently regarding rc and readline. Some time ago, I wrote a readline replacement that does cmdline editing/history, filename completion, etcetera. It is call-compatible with readline() from an rc point of view, but smaller and doesn't exhibit these signal handling problems (I hope, it's a bug otherwise :) I can't put it up for ftp unfortunately, but can mail it if someone is interested. - Last but not least: for my work, I'll be moving from UNIX to Windows NT. Does anyone know about an rc version for NT ? Microsoft has some POSIX.1 support, but it's hardly worth mentioning. Maybe someone tried NutCracker or a similar product ? Gert-Jan PS: Byron, good luck with your studies in Utrecht. I went to school there and graduated from the RUU, not a bad place to live&work :-) From rc-owner Thu Mar 6 05:17:03 1997 Received: from glacier.wise.edt.ericsson.se ([193.180.251.38]) by hawkwind.utcs.utoronto.ca with SMTP id <24628>; Thu, 6 Mar 1997 05:16:41 -0500 Received: from ms.uab.ericsson.se (root@ms.uab.ericsson.se [134.138.2.16]) by glacier.wise.edt.ericsson.se (8.7.5/8.7.3/glacier-0.9) with SMTP id LAA03304 for ; Thu, 6 Mar 1997 11:16:21 +0100 (MET) Received: from uabx01c184.uab.ericsson.se by ms.uab.ericsson.se (4.1/MS-2.1g) id AA20409; Thu, 6 Mar 97 11:16:16 +0100 From: Bengt.Kleberg@ms.uab.ericsson.se (Bengt Kleberg) Received: by uabx01c184.uab.ericsson.se (SMI-8.6/client-1.3) id LAA26568; Thu, 6 Mar 1997 11:16:15 +0100 Date: Thu, 6 Mar 1997 05:16:15 -0500 Message-Id: <199703061016.LAA26568@uabx01c184.uab.ericsson.se> To: rc@hawkwind.utcs.toronto.edu Subject: RC => POSIX X-Sun-Charset: US-ASCII Greetings, I know that this probably will generate a lot of work, but I'm willing to do as much of it as I can (he says, safe in the knowledge that he only has Solaris2). Perhaps as the only change for rc-1.6? What if we wrote rc to posix (or UNIX(tm) if posix isn't enough) and removed as much of the #ifdef's as possible. Then, on systems without posix support, we could create a posix library for that operating system. Only covering the missing posix calls that rc uses, ofcourse. Has this kind of thing been done before and failed? Comments/Suggestions/xxx. (I have done this for some code that run's under 3 similar real time OS's and like the result. But then I don't like #ifdef). Best Wishes, Bengt -------------------------------------------------------------------- Email: Bengt.Kleberg@enea.se (Enea Data AB, Sweden) Disclaimer: Nothing abovementioned has any connection to Enea Data AB ``At the moment money does indeed make the world go round but unfortunately the direction of that applied rotation is all downhill.'' fleecy@netreach.net From rc-owner Thu Mar 6 08:47:42 1997 Received: from mail.clark.net ([168.143.0.10]) by hawkwind.utcs.utoronto.ca with SMTP id <24629>; Thu, 6 Mar 1997 08:47:12 -0500 Received: from explorer2.clark.net (culliton@explorer2.clark.net [168.143.0.5]) by mail.clark.net (8.8.5/8.6.5) with ESMTP id IAA11762; Thu, 6 Mar 1997 08:45:40 -0500 (EST) From: Tom Culliton Received: (from culliton@localhost) by explorer2.clark.net (8.8.5/8.7.1) id IAA24892; Thu, 6 Mar 1997 08:46:06 -0500 (EST) Date: Thu, 6 Mar 1997 08:46:06 -0500 Message-Id: <199703061346.IAA24892@explorer2.clark.net> To: Bengt.Kleberg@ms.uab.ericsson.se, rc@hawkwind.utcs.toronto.edu Subject: Re: RC => POSIX > What if we wrote rc to posix (or UNIX(tm) if posix isn't enough) and > removed as much of the #ifdef's as possible. Then, on systems without > posix support, we could create a posix library for that operating > system. Only covering the missing posix calls that rc uses, ofcourse. > > Has this kind of thing been done before and failed? > Comments/Suggestions/xxx. The problem is harder than that in rc's case. Signal semantics make a good example. To be really posixy you'd use sigaction(), and while you can write signal() in terms of sigaction, the reverse is not very doable. The differences between BSD and SysV signal semantics are one of the reasons that RC has a bunch of #if's. Others include optional features such as readline, nonstandard OS features that make something work in a better, safer way when they're present such as /dev/fd and kernel recognition of "#!" in executable scrpts. All your proposal would do is move the #if's into the compatibility library. BTW - While I'm thinking of it has anyone looked at how much effort it would take to make the /dev/fd code work with a /proc file system? I mean without putting symbolic links in /dev. Actually if that works, as someone suggested, it seems like the code change should be easy... Tom From rc-owner Thu Mar 6 09:10:23 1997 Received: from glacier.wise.edt.ericsson.se ([193.180.251.38]) by hawkwind.utcs.utoronto.ca with SMTP id <24628>; Thu, 6 Mar 1997 09:10:02 -0500 Received: from ms.uab.ericsson.se (root@ms.uab.ericsson.se [134.138.2.16]) by glacier.wise.edt.ericsson.se (8.7.5/8.7.3/glacier-0.9) with SMTP id PAA26378; Thu, 6 Mar 1997 15:09:47 +0100 (MET) Received: from uabx01c184.uab.ericsson.se by ms.uab.ericsson.se (4.1/MS-2.1g) id AA04591; Thu, 6 Mar 97 15:09:46 +0100 From: Bengt.Kleberg@ms.uab.ericsson.se (Bengt Kleberg) Received: by uabx01c184.uab.ericsson.se (SMI-8.6/client-1.3) id PAA27178; Thu, 6 Mar 1997 15:09:45 +0100 Date: Thu, 6 Mar 1997 09:09:45 -0500 Message-Id: <199703061409.PAA27178@uabx01c184.uab.ericsson.se> To: rc@hawkwind.utcs.toronto.edu, culliton@clark.net Subject: Re: RC => POSIX X-Sun-Charset: US-ASCII > From rc-owner@hawkwind.utcs.toronto.edu Thu Mar 6 14:48:52 1997 > From: Tom Culliton > Date: Thu, 6 Mar 1997 08:46:06 -0500 > To: Bengt.Kleberg@ms.uab.ericsson.se, rc@hawkwind.utcs.toronto.edu > Subject: Re: RC => POSIX > > > What if we wrote rc to posix (or UNIX(tm) if posix isn't enough) and > > removed as much of the #ifdef's as possible. Then, on systems without > > posix support, we could create a posix library for that operating > > system. Only covering the missing posix calls that rc uses, ofcourse. > > ...deleted explanation why this wouldn't be a good idea > > OK, I just like the idea, have tried it successfully (with far fewer target systems) and hoped it would be doable. > All your proposal > would do is move the #if's into the compatibility library. Actually I meant to use a specific library for each operating system, so there would be several libraries with no #ifdef's in any of them. This is probably just a case of personal taste. I prefer several libraries, others prefer serveral #ifdef's. Best Wishes, Bengt -------------------------------------------------------------------- Email: Bengt.Kleberg@enea.se (Enea Data AB, Sweden) Disclaimer: Nothing abovementioned has any connection to Enea Data AB ``At the moment money does indeed make the world go round but unfortunately the direction of that applied rotation is all downhill.'' fleecy@netreach.net From rc-owner Thu Mar 6 10:23:42 1997 Received: from mail.clark.net ([168.143.0.10]) by hawkwind.utcs.utoronto.ca with SMTP id <24628>; Thu, 6 Mar 1997 10:22:29 -0500 Received: from explorer2.clark.net (culliton@explorer2.clark.net [168.143.0.5]) by mail.clark.net (8.8.5/8.6.5) with ESMTP id KAA15168; Thu, 6 Mar 1997 10:21:43 -0500 (EST) From: Tom Culliton Received: (from culliton@localhost) by explorer2.clark.net (8.8.5/8.7.1) id KAA24301; Thu, 6 Mar 1997 10:22:09 -0500 (EST) Date: Thu, 6 Mar 1997 10:22:09 -0500 Message-Id: <199703061522.KAA24301@explorer2.clark.net> To: Uhl@rrz.Uni-Koeln.DE Cc: rc@hawkwind.utcs.toronto.edu Subject: Re: RC => POSIX > From: Malte Uhl > > And that's exactly his point! Why use BSD or SysV semantics when you can do > it posixly correct? Uhm... So it'll work on those systems which don't have Posix support? After all, the whole point of #if's for portability is... PORTABILITY! To do wonderful new Posix rewrite of rc for "Posix" systems so it suddenly doesn't work on all the old BSD and SysV systems that it has worked on "all along" would be pretty darned silly in my opinion. I've had to work on and port code to, too many "backwards" systems to leave somebody else swinging in the wind like that. Tom From rc-owner Thu Mar 6 11:55:59 1997 Received: from mail.clark.net ([168.143.0.10]) by hawkwind.utcs.utoronto.ca with SMTP id <24628>; Thu, 6 Mar 1997 11:55:15 -0500 Received: from clark.net (culliton@explorer.clark.net [168.143.0.7]) by mail.clark.net (8.8.5/8.6.5) with ESMTP id LAA19838; Thu, 6 Mar 1997 11:53:57 -0500 (EST) From: Tom Culliton Received: (from culliton@localhost) by clark.net (8.8.5/8.7.1) id LAA10224; Thu, 6 Mar 1997 11:54:24 -0500 (EST) Date: Thu, 6 Mar 1997 11:54:24 -0500 Message-Id: <199703061654.LAA10224@clark.net> To: Uhl@rrz.Uni-Koeln.DE, rc@hawkwind.utcs.toronto.edu Subject: Re: RC => POSIX > From: Malte Uhl > >Agreed, "all the old BSD and SysV systems" would fall behind. But, frankly, I >can hardly remember the last computer without Posix and Xopen support. Can >you provide any numbers to support your point? I'd be very interested in them! > > Malte How does three of the six systems that I've ported rc to strike you? There's a lot of old iron out there doing useful work. Ask Byron, I'm sure he had a lot of mail from folks with strange incompatibilities. Tom From rc-owner Thu Mar 6 11:57:39 1997 Received: from noc.rrz.Uni-Koeln.DE ([134.95.100.209]) by hawkwind.utcs.utoronto.ca with SMTP id <24629>; Thu, 6 Mar 1997 11:57:26 -0500 Received: from noc (localhost [127.0.0.1]) by noc.rrz.Uni-Koeln.DE (8.8.5/8.8.4) with ESMTP id RAA03106 for ; Thu, 6 Mar 1997 17:57:13 +0100 (MET) Message-Id: <199703061657.RAA03106@noc.rrz.Uni-Koeln.DE> X-Mailer: exmh version 1.6.9 8/22/96 To: rc@hawkwind.utcs.toronto.edu Subject: Re: RC => POSIX In-reply-to: Your message of "Thu, 06 Mar 1997 10:12:14 EST." <199703061512.KAA21040@explorer2.clark.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 6 Mar 1997 11:57:13 -0500 From: Malte Uhl > > The problem is harder than that in rc's case. Signal semantics make a > > good example. To be really posixy you'd use sigaction(), and while > > you can write signal() in terms of sigaction, the reverse is not very > > doable. The differences between BSD and SysV signal semantics are one > > of the reasons that RC has a bunch of #if's. > > And that's exactly his point! Why use BSD or SysV semantics when you can do > it posixly correct? > > > Others include optional > > features such as readline, nonstandard OS features that make something > > work in a better, safer way when they're present such as /dev/fd and > > kernel recognition of "#!" in executable scrpts. All your proposal > > would do is move the #if's into the compatibility library. > > Again, that's the very point: To seperate the shells code from the OS stuff > as much as possible. > > I'd even go further suggesting to drop all the "ANSI compatibility" headers > Byron once wrote. They are a major source of problems porting rc to different > platforms and to maintain it. Frequently, the declarations made in them are > slightly incompatible with the systems declarations, although hard clashes > are rare. > > Summarising the intense discussions a few years back, we've concluded not to > add new features so, rewriting to Posix and Xopen specs gets my vote! > > If rc was to be changed, I'd suggest setting the status variable to the > result of a backquote command in an assignment, as in > > ; x=`false || echo error > error > ; > > Malte > > From rc-owner Thu Mar 6 12:16:26 1997 Received: from oldp.nmsu.edu ([128.123.26.31]) by hawkwind.utcs.utoronto.ca with SMTP id <24631>; Thu, 6 Mar 1997 12:16:08 -0500 Received: by oldp.nmsu.edu; id AA30380; Thu, 6 Mar 1997 10:15:49 -0700 Date: Thu, 6 Mar 1997 12:15:49 -0500 From: Alan Watson Message-Id: <9703061715.AA30380@oldp.nmsu.edu> To: rc@hawkwind.utcs.toronto.edu Subject: Re: RC => POSIX Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit > >Agreed, "all the old BSD and SysV systems" would fall behind. > [...] > > [...] > There's a lot of old iron out there doing useful work. Ask Byron, I'm > sure he had a lot of mail from folks with strange incompatibilities. Lets stop and look at where we are. The behaviour of rc is, for all intents and purposes, fixed. We are talking about rc-1.5 not because we want new features or want bugs fixed, but because we want rc-1.4 to work on new iron. Presumably, those people with old iron can continue to run rc-1.4. Making rc-1.5 run on just POSIX systems would make it significantly easier to maintain. Given the resources that are available, this is a very worthy goal. (On a related note, separating rc from readline would make it significantly easier to maintain, but lets not get into that one again.) Alan From rc-owner Thu Mar 6 12:40:37 1997 Received: from mail.clark.net ([168.143.0.10]) by hawkwind.utcs.utoronto.ca with SMTP id <24632>; Thu, 6 Mar 1997 12:40:18 -0500 Received: from clark.net (culliton@explorer.clark.net [168.143.0.7]) by mail.clark.net (8.8.5/8.6.5) with ESMTP id MAA06236; Thu, 6 Mar 1997 12:39:35 -0500 (EST) From: Tom Culliton Received: (from culliton@localhost) by clark.net (8.8.5/8.7.1) id MAA17601; Thu, 6 Mar 1997 12:40:01 -0500 (EST) Date: Thu, 6 Mar 1997 12:40:01 -0500 Message-Id: <199703061740.MAA17601@clark.net> To: alan@oldp.nmsu.edu, rc@hawkwind.utcs.toronto.edu Subject: Re: RC => POSIX > The behaviour of rc is, for all intents and purposes, fixed. We are Agreed... More or less... We never did get an official version with read in it as Byron discussed once. > talking about rc-1.5 not because we want new features or want bugs > fixed, Even if we don't add new features I'd sure like to see bugs fixed! And yes, there are bugs, software without bugs is even rarer than being alive and not having dirty laundry. I'd like to see a 1.5 with the known good fixes incorporated before we start talking about any major rewrites. Personally I plan to do my part by running rc through every static and dynamic checker available to me, and posting fixes for anything that turns up. > but because we want rc-1.4 to work on new iron. Presumably, > those people with old iron can continue to run rc-1.4. This was exactly what I was arguing against! Tom From rc-owner Thu Mar 6 12:55:33 1997 Received: from cse.psu.edu ([130.203.3.50]) by hawkwind.utcs.utoronto.ca with SMTP id <24633>; Thu, 6 Mar 1997 12:55:06 -0500 Received: from eiffel.cse.psu.edu (schwartz@eiffel.cse.psu.edu [130.203.10.16]) by cse.psu.edu (8.8.5/8.7.3) with ESMTP id MAA23504; Thu, 6 Mar 1997 12:54:47 -0500 (EST) Message-Id: <199703061754.MAA23504@cse.psu.edu> To: Alan Watson cc: rc@hawkwind.utcs.toronto.edu Subject: Re: RC => POSIX In-reply-to: Your message of "Thu, 06 Mar 1997 12:15:49 EST." <9703061715.AA30380@oldp.nmsu.edu> Date: Thu, 6 Mar 1997 12:54:59 -0500 From: Scott Schwartz Alan Watson writes: | The behaviour of rc is, for all intents and purposes, fixed. We are | talking about rc-1.5 not because we want new features or want bugs | fixed, but because we want rc-1.4 to work on new iron. Presumably, | those people with old iron can continue to run rc-1.4. On the contrary. If you just ignore all the posix inventions you can still compile and run Unix programs, because posix systems always include compatability features. For example, there's no need for sigaction, because signal does the right thing. From rc-owner Thu Mar 6 20:46:27 1997 Received: from most.weird.com ([204.92.254.2]) by hawkwind.utcs.utoronto.ca with SMTP id <24628>; Thu, 6 Mar 1997 20:45:53 -0500 Received: by most.weird.com via sendmail with stdio id for rc@hawkwind.utcs.toronto.edu; Thu, 6 Mar 1997 20:45:47 -0500 (EST) (Smail-3.2.0.93-pre 1997-Mar-5 #11 built 1997-Mar-5) Message-Id: Date: Thu, 6 Mar 1997 20:45:47 -0500 From: woods@most.weird.com (Greg A. Woods) To: Bengt.Kleberg@ms.uab.ericsson.se (Bengt Kleberg) Cc: rc@hawkwind.utcs.toronto.edu Subject: Re: RC => POSIX In-Reply-To: Bengt Kleberg's message of "Thu, March 6, 1997 05:16:15 -0500" regarding "RC => POSIX" id <199703061016.LAA26568@uabx01c184.uab.ericsson.se> References: <199703061016.LAA26568@uabx01c184.uab.ericsson.se> Reply-To: woods@weird.com (Greg A. Woods) X-Mailer: ViewMail (vm) Version 5.96 (beta) with GNU Emacs 19.34.1 (m68k.68881-sun-sunos4.1.1, X toolkit) of Thu Sep 12 1996 on most Organization: Planix, Inc.; Toronto, Ontario; Canada [ On Thu, March 6, 1997 at 05:16:15 (-0500), Bengt Kleberg wrote: ] > Subject: RC => POSIX > > What if we wrote rc to posix (or UNIX(tm) if posix isn't enough) and > removed as much of the #ifdef's as possible. Then, on systems without > posix support, we could create a posix library for that operating > system. Only covering the missing posix calls that rc uses, ofcourse. It would be far more productive and result in a far more portable product to integrate GNU Autoconf et al and didn't I just see a note about es being autoconf'ed pass by here earlier? Taking the autoconf support from es should be trivial, esp. to any rc-internals programmer with any experience using autoconf. The GNU Autoconf philosophy is similar in some ways to what you suggest, esp. in that autoconf'ed packages usually provide a compatability library for those system functions the software uses but which are not always available on all systems. However the autoconf style isn't anywhere nearly so restrictive as porting directly to plain POSIX would be. (BTW, w.r.t. the GNU readline signal problems, my adivce is don't use GNU readline -- it isn't very good at what it does, is far too big, and is very difficult to integrate into a program that tries to do job control. There were other command-line editing libraries for rc long ago, and there are other new ones too that might be tried. I've had good luck with the command-line editing support in pdksh and it seems to integrate well with a shell, and it supports both vi and emacs modes.) -- Greg A. Woods +1 416 443-1734 VE3TCP robohack!woods Planix, Inc. ; Secrets of the Weird From rc-owner Thu Mar 6 21:03:11 1997 Received: from mail.clark.net ([168.143.0.10]) by hawkwind.utcs.utoronto.ca with SMTP id <24628>; Thu, 6 Mar 1997 21:02:51 -0500 Received: from explorer2.clark.net (culliton@explorer2.clark.net [168.143.0.5]) by mail.clark.net (8.8.5/8.6.5) with ESMTP id VAA04819 for ; Thu, 6 Mar 1997 21:01:59 -0500 (EST) From: Tom Culliton Received: (from culliton@localhost) by explorer2.clark.net (8.8.5/8.7.1) id VAA24056 for rc@hawkwind.utcs.toronto.edu; Thu, 6 Mar 1997 21:02:32 -0500 (EST) Date: Thu, 6 Mar 1997 21:02:32 -0500 Message-Id: <199703070202.VAA24056@explorer2.clark.net> To: rc@hawkwind.utcs.toronto.edu Subject: /dev/fd -> /proc/self/fd I seem to have lost the message that someone recently sent about doing this, can someone give me a clue? Someone who saved the message? Someone who has done it? Whoever sent the original message? I swear I'm not hallucinating, although maybe it was on a different mailing list or news group... Failing that, what is the behaviour of /dev/fd? Is it a directory that "magically" contains numeric filenames corresponding to the reading processes open fd's like /proc/self/fd? Somebody had to understand this to implement the original code. ;-) BTW - Chris, where are the mailing list archives these days? Thanks! Tom From rc-owner Thu Mar 6 21:42:59 1997 Received: from mail.clark.net ([168.143.0.10]) by hawkwind.utcs.utoronto.ca with SMTP id <24629>; Thu, 6 Mar 1997 21:42:46 -0500 Received: from clark.net (culliton@explorer.clark.net [168.143.0.7]) by mail.clark.net (8.8.5/8.6.5) with ESMTP id VAA17495; Thu, 6 Mar 1997 21:42:08 -0500 (EST) From: Tom Culliton Received: (from culliton@localhost) by clark.net (8.8.5/8.7.1) id VAA17192; Thu, 6 Mar 1997 21:42:42 -0500 (EST) Date: Thu, 6 Mar 1997 21:42:42 -0500 Message-Id: <199703070242.VAA17192@clark.net> To: culliton@clark.net, rc@hawkwind.utcs.toronto.edu Subject: Re: /dev/fd -> /proc/self/fd Never mind, I figured it out already. ;-) Here's the patch. And for those who dislike such things, this one doesn't require any new #if's. Tom ;-) ;-) ;-) ------------------------------------------------------------------------ *** ../rc-1.5betadev-1/glom.c Sun Mar 6 22:33:00 1994 --- glom.c Thu Mar 6 21:20:17 1997 *************** *** 347,353 **** walk(n->u[2].p, FALSE); exit(getstatus()); } ! name = nprint("/dev/fd/%d", p[n->u[0].i != rFrom]); efd.fd = p[n->u[0].i != rFrom]; except(eFd, efd, e); close(p[n->u[0].i == rFrom]); --- 347,353 ---- walk(n->u[2].p, FALSE); exit(getstatus()); } ! name = nprint(DEVFD, p[n->u[0].i != rFrom]); efd.fd = p[n->u[0].i != rFrom]; except(eFd, efd, e); close(p[n->u[0].i == rFrom]); *** ../rc-1.5betadev-1/config.h-dist Mon May 25 14:12:57 1992 --- config.h-dist Thu Mar 6 21:14:44 1997 *************** *** 47,55 **** */ /* ! * Define the macro DEVFD if your system supports /dev/fd. ! #define DEVFD */ /* * Define the macro NOLIMITS if your system does not support Berkeley --- 47,56 ---- */ /* ! * Define the macro DEVFD if your system supports /dev/fd or /proc/self/fd. ! #define DEVFD "/dev/fd/%d" + #define DEVFD "/proc/self/fd/%d" */ /* * Define the macro NOLIMITS if your system does not support Berkeley *************** From rc-owner Fri Mar 7 19:16:05 1997 Received: from weaver-gw.netapp.com ([198.95.224.2]) by hawkwind.utcs.utoronto.ca with SMTP id <24628>; Fri, 7 Mar 1997 19:12:47 -0500 Received: from netapp.com ([192.9.200.1]) by weaver.netapp.com with SMTP id <15928-118>; Fri, 7 Mar 1997 16:12:34 -0000 Received: from nova.netapp.com by netapp.com (4.1/SMI-4.1) id AA24172; Fri, 7 Mar 97 16:13:40 PST Received: by nova.netapp.com (4.1/SMI-4.1) id AA09063; Fri, 7 Mar 97 16:13:38 PST Date: Fri, 7 Mar 1997 19:13:38 -0500 From: byron@netapp.com (Byron Rakitzis) Message-Id: <9703080013.AA09063@nova.netapp.com> To: Uhl@rrz.Uni-Koeln.DE, rc@hawkwind.utcs.toronto.edu Subject: Re: RC => POSIX >Bengt Kleberg -- RC => POSIX >Tom Culliton -- Re: RC => POSIX >Bengt Kleberg -- Re: RC => POSIX >Tom Culliton -- Re: RC => POSIX >Malte Uhl -- Re: RC => POSIX >Tom Culliton -- Re: RC => POSIX >Alan Watson -- Re: RC => POSIX >Tom Culliton -- Re: RC => POSIX >Scott Schwartz -- Re: RC => POSIX >Greg A. Woods -- Re: RC => POSIX A quick and necessarily incomplete reply to all this mail. First of all I want to resist posixifying rc. It is a shell which in fact enjoys wide portability, and I think it would be a mistake to limit the use of subsequent versions to posix systems. I agree that the ANSI header files are probably a mistake. The reason why they are a mistake is again that they limit portability. Byron. From rc-owner Sat Mar 8 23:26:02 1997 Received: from austin.cs.unc.edu ([152.2.128.87]) by hawkwind.utcs.utoronto.ca with SMTP id <24628>; Sat, 8 Mar 1997 23:24:55 -0500 Received: from rukbat.cs.unc.edu by austin.cs.unc.edu (8.6.10/UNC_10_05_96) id XAA09573; Sat, 8 Mar 1997 23:24:52 -0500 Received: from localhost by rukbat.cs.unc.edu (8.6.10/UNC_06_21_94) id XAA08439; Sat, 8 Mar 1997 23:24:51 -0500 Date: Sat, 8 Mar 1997 23:24:51 -0500 From: Stephen Tell To: Tom Culliton cc: rc@hawkwind.utcs.toronto.edu Subject: Re: rc, signals, readline, and Linux In-Reply-To: <199703050555.AAA13494@explorer2.clark.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Wed, 5 Mar 1997, Tom Culliton wrote: > So my big **** eating grin might tell you something. 8-) Thats right, > unless I've overlooked something really dumb, it's fixed!!! This fix I've been trying to get rc going on my new linux box recently; Tom's patches definitely help a lot. SIGINT definitely works properly with readline now. This is enough improvement that I've installed it as my default. All is not quite perfect, however. "make trip" hang on the first line in the history section: history=/tmp/hist.$pid prompt='' echo 'history=()' | $rc -i No history file is created in /tmp, and "./rc -i" is looping burning cpu cycles. Doing a similar history operation interactively (without -i) seems to work. I tried compiling rc 1.4 in the same environment with the same readline, and it does the same thing. Killing the looping rc -i and doing a postmortem gdb traceback suggests that the problem is probably readline-related: liriel;rc-1.5tjc; gdb ./rc core GDB is free software and you are welcome to distribute copies of it under certain conditions; type "show copying" to see the conditions. There is absolutely no warranty for GDB; type "show warranty" for details. GDB 4.16 (i586-unknown-linux), Copyright 1996 Free Software Foundation, Inc... Core was generated by `./rc -i'. Program terminated with signal 6, IOT trap/Abort. Reading symbols from /usr/lib/libreadline.so.2.0...done. Reading symbols from /lib/libc.so.5.3.12...done. Reading symbols from /lib/ld-linux.so.1...done. #0 0x4003c77c in ioctl () (gdb) bt #0 0x4003c77c in ioctl () #1 0x40016643 in get_tty_settings () #2 0x400169a1 in rltty_set_default_bindings () #3 0x400106fe in readline_default_bindings () #4 0x4001067b in readline_initialize_everything () #5 0x40010500 in rl_initialize () #6 0x4000f8bc in readline () #7 0x8050ff9 in rc_readline (prompt=0x0) at input.c:101 #8 0x8051834 in doit (execit=-1073743311) at input.c:300 Also, gcc makes these complaints while compiling. I haven't tried to figure out if they're worth worrying about or not. input.c: In function `doit': input.c:260: warning: argument `execit' might be clobbered by `longjmp' or `vfork' utils.c: In function `writeall': utils.c:69: warning: argument `buf' might be clobbered by `longjmp' or `vfork' utils.c:69: warning: argument `remain' might be clobbered by `longjmp' or `vfork' walk.c: In function `walk': walk.c:24: warning: argument `n' might be clobbered by `longjmp' or `vfork' System Info: Pentium 166 Red Hat Linux 4.0 (kernel 2.0.18) gcc version 2.7.2 libc 5.3.12 readline is readline-2.0-10.i386.rpm from the Red Hat distribution. Thanks for everyone's efforts. I'll soon try building at work, first on HP-UX 10.20 and 9.05, then SunOS, Solaris, Mips-Ultrix, and SGI. Steve Steve Tell tell@cs.unc.edu W: +1 919 962 1845 Research Associate, Computer Science Department, UNC@Chapel Hill. If you're determined to reinvent the wheel, at least try to invent a better one. From rc-owner Sun Mar 9 00:32:13 1997 Received: from mail.clark.net ([168.143.0.10]) by hawkwind.utcs.utoronto.ca with SMTP id <24628>; Sun, 9 Mar 1997 00:31:59 -0500 Received: from explorer2.clark.net (culliton@explorer2.clark.net [168.143.0.5]) by mail.clark.net (8.8.5/8.6.5) with ESMTP id AAA06055; Sun, 9 Mar 1997 00:31:53 -0500 (EST) From: Tom Culliton Received: (from culliton@localhost) by explorer2.clark.net (8.8.5/8.7.1) id AAA21257; Sun, 9 Mar 1997 00:31:40 -0500 (EST) Date: Sun, 9 Mar 1997 00:31:40 -0500 Message-Id: <199703090531.AAA21257@explorer2.clark.net> To: culliton@clark.net, tell@cs.unc.edu Cc: rc@hawkwind.utcs.toronto.edu Subject: Re: rc, signals, readline, and Linux > On Wed, 5 Mar 1997, Tom Culliton wrote: > > So my big **** eating grin might tell you something. 8-) Thats right, > > unless I've overlooked something really dumb, it's fixed!!! This fix > > I've been trying to get rc going on my new linux box recently; > Tom's patches definitely help a lot. SIGINT definitely works properly with > readline now. This is enough improvement that I've installed it as my > default. > > All is not quite perfect, however. > > "make trip" hang on the first line in the history section: > > history=/tmp/hist.$pid prompt='' echo 'history=()' | $rc -i > > No history file is created in /tmp, and "./rc -i" is looping burning > cpu cycles. Yeah, I reported this earlier. You must ahve either missed the message or it was one of the ones that bounced from the list. For some reason this problem occurs with readline under Linux if you don't link statically. Go back and look at my configuration patches which include the proper link switches to make this happen. What is needed is somthing like: LDFLAGS= -static -lreadline -ltermcap : : rc: $(OBJS) $(CC) -o $@ $(OBJS) $(LDFLAGS) With this rc should trip flawlessly. I spent a bunch of time fiddling with it, saw the same stack traces, but decided in the end that it had already cost enough brain cells, and I really didn't give a hoot if the binary was statically linked or not. I'll leave that one for someone else, who has more experience with dynamic linking under Linux to solve. ;-) ;-) ;-) Tom From rc-owner Thu Mar 13 17:00:11 1997 Received: from mail.clark.net ([168.143.0.10]) by hawkwind.utcs.utoronto.ca with SMTP id <24628>; Thu, 13 Mar 1997 16:58:00 -0500 Received: from explorer2.clark.net (culliton@explorer2.clark.net [168.143.0.5]) by mail.clark.net (8.8.5/8.6.5) with ESMTP id QAA25495 for ; Thu, 13 Mar 1997 16:57:29 -0500 (EST) From: Tom Culliton Received: (from culliton@localhost) by explorer2.clark.net (8.8.5/8.7.1) id QAA04007 for rc@hawkwind.utcs.toronto.edu; Thu, 13 Mar 1997 16:57:14 -0500 (EST) Date: Thu, 13 Mar 1997 16:57:14 -0500 Message-Id: <199703132157.QAA04007@explorer2.clark.net> To: rc@hawkwind.utcs.toronto.edu Subject: Intresting quirk in <{} I saw something odd last night while trying to check for collisions between two different directories. diff -D <{ls} <{builtin cd dir2 ; ls} The cd never happened, both ls's ran in the current directory. Clues? Tom From rc-owner Mon Mar 24 04:32:29 1997 Received: from glacier.wise.edt.ericsson.se ([193.180.251.38]) by hawkwind.utcs.utoronto.ca with SMTP id <24637>; Mon, 24 Mar 1997 04:30:27 -0500 Received: from ms.uab.ericsson.se (root@ms.uab.ericsson.se [134.138.2.16]) by glacier.wise.edt.ericsson.se (8.7.5/8.7.3/glacier-0.9) with SMTP id KAA23522; Mon, 24 Mar 1997 10:18:27 +0100 (MET) Received: from uabx04c397.uab.ericsson.se by ms.uab.ericsson.se (4.1/MS-2.1j) id AA00274; Mon, 24 Mar 97 10:18:15 +0100 From: Bengt.Kleberg@uab.ericsson.se (Bengt Kleberg) Received: by uabx04c397.uab.ericsson.se (SMI-8.6/client-1.3) id KAA15116; Mon, 24 Mar 1997 10:18:15 +0100 Date: Mon, 24 Mar 1997 04:18:15 -0500 Message-Id: <199703240918.KAA15116@uabx04c397.uab.ericsson.se> To: woods@weird.com Subject: Re: RC => POSIX Cc: rc@hawkwind.utcs.toronto.edu X-Sun-Charset: US-ASCII ...deleted > It would be far more productive and result in a far more portable > product to integrate GNU Autoconf et al and didn't I just see a note > about es being autoconf'ed pass by here earlier? Taking the autoconf > support from es should be trivial, esp. to any rc-internals programmer > with any experience using autoconf. > Byron has written that it is better to be portable than POSIX. He even mentioned ANSI C as a stumbeling block for portablility. To be consequent I therefore suggest that ANSI C is dropped (or POSIX adopted :-) > The GNU Autoconf philosophy is similar in some ways to what you suggest, > esp. in that autoconf'ed packages usually provide a compatability > library for those system functions the software uses but which are not > always available on all systems. However the autoconf style isn't > anywhere nearly so restrictive as porting directly to plain POSIX would > be. This is what I don't like. When it comes to programming I prefer restrictions. ...deleted Best Wishes, Bengt -------------------------------------------------------------------- Email: Bengt.Kleberg@enea.se (Enea Data AB, Sweden) Disclaimer: Nothing abovementioned has any connection to Enea Data AB ``At the moment money does indeed make the world go round but unfortunately the direction of that applied rotation is all downhill.'' fleecy@netreach.net From rc-owner Mon Mar 24 16:47:12 1997 Received: from most.weird.com ([204.92.254.2]) by hawkwind.utcs.utoronto.ca with SMTP id <24664>; Mon, 24 Mar 1997 16:38:57 -0500 Received: by most.weird.com via sendmail with stdio id for rc@hawkwind.utcs.toronto.edu; Mon, 24 Mar 1997 15:22:12 -0500 (EST) (Smail-3.2.0.93-pre 1997-Mar-5 #11 built 1997-Mar-5) Message-Id: Date: Mon, 24 Mar 1997 15:22:12 -0500 From: woods@most.weird.com (Greg A. Woods) To: Bengt.Kleberg@uab.ericsson.se (Bengt Kleberg) Cc: rc@hawkwind.utcs.toronto.edu Subject: Re: RC => POSIX In-Reply-To: Bengt Kleberg's message of "Mon, March 24, 1997 10:18:15 +0100" regarding "Re: RC => POSIX" id <199703240918.KAA15116@uabx04c397.uab.ericsson.se> References: <199703240918.KAA15116@uabx04c397.uab.ericsson.se> Reply-To: woods@weird.com (Greg A. Woods) X-Mailer: ViewMail (vm) Version 5.96 (beta) with GNU Emacs 19.34.1 (m68k.68881-sun-sunos4.1.1, X toolkit) of Thu Sep 12 1996 on most Organization: Planix, Inc.; Toronto, Ontario; Canada [ On Mon, March 24, 1997 at 10:18:15 (+0100), Bengt Kleberg wrote: ] > Subject: Re: RC => POSIX > > This is what I don't like. When it comes to programming I prefer restrictions. Perhaps you're not aware of just how restrictive POSIX programming must be. Where it's not restricted things are left completely un-defined. At least with the general GNU coding all variants of systems can be taken into account and all features of systems can be used. -- Greg A. Woods +1 416 443-1734 VE3TCP robohack!woods Planix, Inc. ; Secrets of the Weird From rc-owner Tue Mar 25 17:32:47 1997 Received: from weaver-gw.netapp.com ([198.95.224.2]) by hawkwind.utcs.utoronto.ca with SMTP id <24642>; Tue, 25 Mar 1997 17:30:16 -0500 Received: from netapp.com ([192.9.200.1]) by weaver.netapp.com with SMTP id <15948-1940>; Tue, 25 Mar 1997 14:29:18 -0000 Received: by netapp.com (4.1/SMI-4.1) id AA13737; Tue, 25 Mar 97 14:30:43 PST Date: Tue, 25 Mar 1997 17:30:43 -0500 From: byron@netapp.com (Byron Rakitzis) Message-Id: <9703252230.AA13737@netapp.com> To: Bengt.Kleberg@uab.ericsson.se, woods@weird.com Subject: Re: RC => POSIX Cc: rc@hawkwind.utcs.toronto.edu >Byron has written that it is better to be portable than POSIX. He even >mentioned ANSI C as a stumbeling block for portablility. To be >consequent I therefore suggest that ANSI C is dropped (or POSIX adopted :-) I'm not sure what you are saying here. I think I mentioned that the fake ansi headers that rc ships are an obstacle to portability. That doesn't have much to do with ansi C. I think I would like to clean up the source so that it compiles with an ANSI compiler, but omit the home-grown system prototypes and typedefs. Perhaps such home-grown prototypes anticipate portability problems (e.g., having size_t be signed as on SunOS 4 could imply any number of bugs if the code assumes unsigned), but I am not sure. From rc-owner Wed Mar 26 03:38:35 1997 Received: from glacier.wise.edt.ericsson.se ([193.180.251.38]) by hawkwind.utcs.utoronto.ca with SMTP id <24664>; Wed, 26 Mar 1997 03:35:13 -0500 Received: from ms.uab.ericsson.se (root@ms.uab.ericsson.se [134.138.2.16]) by glacier.wise.edt.ericsson.se (8.7.5/8.7.3/glacier-0.9) with SMTP id JAA09521; Wed, 26 Mar 1997 09:33:06 +0100 (MET) Received: from uabx04c397.uab.ericsson.se by ms.uab.ericsson.se (4.1/MS-2.1j) id AA24870; Wed, 26 Mar 97 09:33:05 +0100 From: Bengt.Kleberg@uab.ericsson.se (Bengt Kleberg) Received: by uabx04c397.uab.ericsson.se (SMI-8.6/client-1.3) id JAA02345; Wed, 26 Mar 1997 09:33:04 +0100 Date: Wed, 26 Mar 1997 03:33:04 -0500 Message-Id: <199703260833.JAA02345@uabx04c397.uab.ericsson.se> To: woods@weird.com, byron@netapp.com Subject: Re: RC => POSIX Cc: rc@hawkwind.utcs.toronto.edu X-Sun-Charset: US-ASCII > >Byron has written that it is better to be portable than POSIX. He even > >mentioned ANSI C as a stumbeling block for portablility. To be > >consequent I therefore suggest that ANSI C is dropped (or POSIX adopted :-) > > I'm not sure what you are saying here. I think I mentioned that > the fake ansi headers that rc ships are an obstacle to portability. > That doesn't have much to do with ansi C. > I apologise for any confusion (especially if my email, by mistake, can be considered negative towards Mr Rakitzis). I interpreted Mr Rakitzis previous message as a suggestion that ANSI function prototypes should go, since K&R C is more portable (available on more systems). Best Wishes, Bengt -------------------------------------------------------------------- New Email => bengtk@damek.kth.se Disclaimer: As far as I know the abovementioned opinions where only mine. ``At the moment money does indeed make the world go round but unfortunately the direction of that applied rotation is all downhill.'' fleecy@netreach.net From rc-owner Wed Mar 26 11:37:37 1997 Received: from weaver-gw.netapp.com ([198.95.224.2]) by hawkwind.utcs.utoronto.ca with SMTP id <24645>; Wed, 26 Mar 1997 11:34:06 -0500 Received: from netapp.com ([192.9.200.1]) by weaver.netapp.com with SMTP id <15868-1945>; Wed, 26 Mar 1997 03:52:59 -0000 Received: by netapp.com (4.1/SMI-4.1) id AA02882; Wed, 26 Mar 97 03:54:26 PST Date: Wed, 26 Mar 1997 06:54:26 -0500 From: byron@netapp.com (Byron Rakitzis) Message-Id: <9703261154.AA02882@netapp.com> To: Bengt.Kleberg@uab.ericsson.se, byron@netapp.com, woods@weird.com Subject: Re: RC => POSIX Cc: rc@hawkwind.utcs.toronto.edu Hey, you don't have to switch to my last name! I hope my last message was not taken in the wrong light. I was just trying to clarify my previous words. I don't think prototyped code should go. ANSI compilers are practically ubiquitous, and there are filters for converting code to the old style. Early on, in 1991 maybe, I seem to remember someone going through this exercise. I think it would help to clearly define what the goal is of changing the style with which rc is now coded. I would like to remain compatible with whatever machines out there right now happily compile and run rc, and I would also like to make it possible for rc to be easily ported to a unix that isn't predefined in config.h. Would all such new unices support posix? Does gnu autoconf effectively cover the entire space of unices? Byron. From rc-owner Wed Mar 26 14:57:02 1997 Received: from most.weird.com ([204.92.254.2]) by hawkwind.utcs.utoronto.ca with SMTP id <24634>; Wed, 26 Mar 1997 14:54:17 -0500 Received: by most.weird.com via sendmail with stdio id for rc@hawkwind.utcs.toronto.edu; Wed, 26 Mar 1997 11:38:37 -0500 (EST) (Smail-3.2.0.93-pre 1997-Mar-5 #11 built 1997-Mar-5) Message-Id: Date: Wed, 26 Mar 1997 11:38:37 -0500 From: woods@most.weird.com (Greg A. Woods) To: rc@hawkwind.utcs.toronto.edu Subject: Re: RC => POSIX In-Reply-To: Bengt Kleberg's message of "Wed, March 26, 1997 09:33:04 +0100" regarding "Re: RC => POSIX" id <199703260833.JAA02345@uabx04c397.uab.ericsson.se> References: <199703260833.JAA02345@uabx04c397.uab.ericsson.se> Reply-To: woods@weird.com (Greg A. Woods) X-Mailer: ViewMail (vm) Version 5.96 (beta) with GNU Emacs 19.34.1 (m68k.68881-sun-sunos4.1.1, X toolkit) of Thu Sep 12 1996 on most Organization: Planix, Inc.; Toronto, Ontario; Canada [ On Wed, March 26, 1997 at 09:33:04 (+0100), Bengt Kleberg wrote: ] > Subject: Re: RC => POSIX > > I interpreted Mr Rakitzis previous message as a suggestion that ANSI > function prototypes should go, since K&R C is more portable (available > on more systems). The problem is that while prototypes help catch parameter mismatches, they must be used with strict new-style function definition syntax, esp. with some less lax ANSI compilers (this is due to incompatabilities invoving type promotion in expressions between ANSI C and K&R C). As a result the code gets very messy if you try to #ifdef both styles. Indeed pure K&R C is still far more portable, and with careful use of lint, still safer (in the sense that more function call problems can be prevented) than most ANSI compilers are today. Where I'm getting at here is that the most portable style of C coding is probably to use ANSI definitions and prototypes exclusively, and rely on some tool such as unproto or ansi2knr to automatically support older compilers. BTW, I've had far better luck with unproto, and it doesn't require any makefile magic if it's installed properly on the target system, though ansi2knr (from the GNU automake distribution) is easier to use since you ship it with the package and automake does all the "right" things to build portable makefiles for using it. This of course necessitates still running lint occasionally with k&r type promotion checking turned on and inserting all casts necessary for k&r in function calls. This is probably what would be best for rc since most of the developers are likely to use ANSI C compilers and thus can benefit immeadiately from prototype checking even if they don't have a working lint implementation in their enironments. Personally I detest ANSI function definition syntax (it is difficult to read and very inelegant), and so I stick to straight k&r C in my own code and rely on lint for more complex syntax checking. Prototypes can even work if you're using an ANSI compiler that can be told to always follow k&r type promotion (eg. GCC). -- Greg A. Woods +1 416 443-1734 VE3TCP robohack!woods Planix, Inc. ; Secrets of the Weird From rc-owner Wed Mar 26 14:58:30 1997 Received: from most.weird.com ([204.92.254.2]) by hawkwind.utcs.utoronto.ca with SMTP id <24642>; Wed, 26 Mar 1997 14:56:56 -0500 Received: by most.weird.com via sendmail with stdio id for rc@hawkwind.utcs.toronto.edu; Wed, 26 Mar 1997 11:45:04 -0500 (EST) (Smail-3.2.0.93-pre 1997-Mar-5 #11 built 1997-Mar-5) Message-Id: Date: Wed, 26 Mar 1997 11:45:04 -0500 From: woods@most.weird.com (Greg A. Woods) To: byron@netapp.com (Byron Rakitzis) Cc: rc@hawkwind.utcs.toronto.edu Subject: Re: RC => POSIX In-Reply-To: Byron Rakitzis's message of "Wed, March 26, 1997 03:54:26 PST" regarding "Re: RC => POSIX" id <9703261154.AA02882@netapp.com> References: <9703261154.AA02882@netapp.com> Reply-To: woods@weird.com (Greg A. Woods) X-Mailer: ViewMail (vm) Version 5.96 (beta) with GNU Emacs 19.34.1 (m68k.68881-sun-sunos4.1.1, X toolkit) of Thu Sep 12 1996 on most Organization: Planix, Inc.; Toronto, Ontario; Canada [ On Wed, March 26, 1997 at 03:54:26 (PST), Byron Rakitzis wrote: ] > Subject: Re: RC => POSIX > > Would all such new unices support posix? Most are close, but not that many are officially branded (or even tested). > Does gnu autoconf effectively > cover the entire space of unices? All that I've encountered though I have not tried running it on something like SysVr2 or even SysVr3. Of course autoconf is extensible if necessary, and will no doubt be fixed as incompatabilities appear too. The latest version of autoconf generated configure scripts are known to fail on some ancient versions of sh, but I've found that all such systems with broken /bin/sh's also have newer shells, such as ksh, installed by default, so it's trivial for the user to work around such problems. -- Greg A. Woods +1 416 443-1734 VE3TCP robohack!woods Planix, Inc. ; Secrets of the Weird From rc-owner Thu Mar 27 17:09:30 1997 Received: from noc.rrz.Uni-Koeln.DE ([134.95.100.209]) by hawkwind.utcs.utoronto.ca with SMTP id <24637>; Thu, 27 Mar 1997 17:06:05 -0500 Received: from noc (localhost [127.0.0.1]) by noc.rrz.Uni-Koeln.DE (8.8.5/8.8.4) with ESMTP id KAA08660; Thu, 27 Mar 1997 10:58:51 +0100 (MET) Message-Id: <199703270958.KAA08660@noc.rrz.Uni-Koeln.DE> X-Mailer: exmh version 2.0gamma 1/27/96 To: rc@hawkwind.utcs.toronto.edu cc: uhl@rrz.uni-koeln.de Subject: Re: RC => POSIX Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 27 Mar 1997 04:58:50 -0500 From: Malte Uhl Fellow rc'ers, I'd like to vote in favour of modifying rc's code for Posix compatibility. Not because Posix (and XOPEN for that matter) compatibility is a good thing in itself, but because Posix provides a standard way to avoid BSD'isms and SysV'isms. Even Windows NT claims to be Posix conformant. Conforming to Posix and XOPEN standards does reduce porting efforts! This is from personal experience. But how many systems are there not supporting these standards? Well, few compared to the number of up to date or recently upgraded systems (let's say no older than 3 years). Even the GNU C library, Linus, NetBSD and Minix claim to be compatible. On those systems not compatible one can choose to run the 1.5 version, or alternatively install their own Posix compatibility library. Now, let me comment on the claims that K&R C + lint is more portable that ANSI C: First of all, one has to redo the lint checking on every (new) system. If lint does find problems, one will have to redo the neccessary changes, too, leaving asize the fact that some people will not be able to do this because of a lack of knowledge. Alternatively, lint checking can be done once for every supported system, but then there'll be quite a few #ifdef's. Given lint does not find (m)any problems, I postulate it could have been coded in ANSI C as well. Secondly, even if all my above ranting were false, I wonder why Ansi C + lint should be inferior. Also note, that ANSI C standardizes some part of the C library. Thirdly, the problem with K&R vs. ANSI declarations has long been solved by the GNU ansidecl.h header. Well, ok, not solved but alleviated. About GNU autoconf, let me say that I it's a bitter-sweet thing. For those who do not know, it's a feature test facility, generating C header files for a particular system from an abstract specification made by the developer of the software. It's sweet because it does it's job very well. But it's bitter because it doesn't check for groups of features, but each one on its own, e.g. it does not test if a system is ANSI C/Posix compatible and then configures the software to use all the Posix features, but tests every feature required independantly of the others. If, as a programmer, you should choose to use poll and select, autoconf will check both features and allow you to use both if available, although there's no point in doing so. In my opinion autoconf should configure the software to use either a native API or a standard API but not allow features to be mixed up. There should at least be a warning in this case. And now for those who are still reading, I know that Posix is not a single fixed standard, covering all fields of system programming. But it does offer some very useful features, such as signal semantics which is a well thought out generalization of BSD and SysV style and it offers standard access to several timer functions and job control, too. To me, this is reason enough to stick to Posix/XOPEN wherever possible. Malte From rc-owner Sun Mar 30 00:08:09 1997 Received: from ankaret.damek.kth.se ([130.237.57.10]) by hawkwind.utcs.utoronto.ca with SMTP id <24635>; Sun, 30 Mar 1997 00:05:53 -0500 Received: (from bengtk@localhost) by ankaret.damek.kth.se (8.6.9/8.6.9) id VAA23202; Sat, 29 Mar 1997 21:23:28 +0100 Date: Sat, 29 Mar 1997 15:23:28 -0500 From: Bengt Kleberg Message-Id: <199703292023.VAA23202@ankaret.damek.kth.se> To: Uhl@rrz.uni-koeln.de, rc@hawkwind.utcs.toronto.edu Subject: Re: RC => POSIX Cc: uhl@rrz.uni-koeln.de Content-Length: 324 > I'd like to vote in favour of modifying rc's code for Posix compatibility. Shouldn't we first decide if we should vote? And if so, how should we vote? For instance, I think that Byron should have atleast as many votes as every body else combined (only half joking :-) But, yes, I still think POSIX is a good idea. Bengt From rc-owner Tue Apr 1 18:02:34 1997 Received: from weaver-gw.netapp.com ([198.95.224.2]) by hawkwind.utcs.utoronto.ca with SMTP id <24682>; Tue, 1 Apr 1997 17:58:43 -0500 Received: from netapp.com ([192.9.200.1]) by weaver.netapp.com with SMTP id <15957-121>; Tue, 1 Apr 1997 11:27:11 -0000 Received: by netapp.com (4.1/SMI-4.1) id AA27920; Tue, 1 Apr 97 11:28:39 PST Date: Tue, 1 Apr 1997 14:28:39 -0500 From: byron@netapp.com (Byron Rakitzis) Message-Id: <9704011928.AA27920@netapp.com> To: rc@hawkwind.utcs.toronto.edu Subject: autoconfig Ok, I've been thinking some more about this and I went through rc's config.h to see what could be done about it all. Here's a walk through the list of options in config.h, I wanted to see if I could get rid of most or all of them: > #define DEFAULTPATH "/usr/ucb", "/usr/bin", "/bin", "." I think this can be deduced by running /bin/sh as a login shell with $PATH unset, and snarfing the output of "echo $PATH". > #define NODIRENT > #define SVSIGS Handled by GNU autoconf. > #define NOCMDARG > #define DEVFD > #define TMPDIR "/var/tmp" I am sorely tempted to remove named pipe support. It never worked properly. So something is needed to auto-sense the particular encoding for /dev/fd (systems encode this differently), which I doubt is supplied by GNU autoconf. > #define NOLIMITS Should be handled by autoconf, or can be extended to do so. > #define NOSIGCLD Handled by autoconf. > #define READLINE Leave this as-is. > #define NOEXECVE I think I should bundle my fake execve; it is a very small amount of code and will only cause extra file opens and the like on an exec failure, which is out of the "performance loop". > #define DEFAULTINTERP "/bin/sh" Ditto, this should just be a standard feature. > #define PROTECT_ENV Given that every /bin/sh I have tried croaks on rc-native environment variable representation in some way or other, PROTECT_ENV should be the only method for encoding env. variable names. > #define NOECHO rc's echo should be built in. > #define NOJOB Does anyone use this? It forces sh-like semantics for backgrounding. Why should it be an option? I haven't found a use for it, but I think I put it in in self-defense early on. My conclusion: It seems that rc + an autoconfig script could take out all the configuration options. I don't see the point of going with Posix, then. From rc-owner Tue Apr 1 23:35:34 1997 Received: from most.weird.com ([204.92.254.2]) by hawkwind.utcs.utoronto.ca with SMTP id <24648>; Tue, 1 Apr 1997 23:34:32 -0500 Received: by most.weird.com via sendmail with stdio id for rc@hawkwind.utcs.toronto.edu; Tue, 1 Apr 1997 20:11:13 -0500 (EST) (Smail-3.2.0.93-pre 1997-Mar-5 #11 built 1997-Mar-5) Message-Id: Date: Tue, 1 Apr 1997 20:11:13 -0500 From: woods@most.weird.com (Greg A. Woods) To: rc@hawkwind.utcs.toronto.edu Subject: Re: autoconfig In-Reply-To: Byron Rakitzis's message of "Tue, April 1, 1997 14:28:39 -0500" regarding "autoconfig" id <9704011928.AA27920@netapp.com> References: <9704011928.AA27920@netapp.com> Reply-To: woods@weird.com (Greg A. Woods) X-Mailer: ViewMail (vm) Version 5.96 (beta) with GNU Emacs 19.34.1 (m68k.68881-sun-sunos4.1.1, X toolkit) of Thu Sep 12 1996 on most Organization: Planix, Inc.; Toronto, Ontario; Canada [ On Tue, April 1, 1997 at 14:28:39 (-0500), Byron Rakitzis wrote: ] > Subject: autoconfig > > > #define DEFAULTPATH "/usr/ucb", "/usr/bin", "/bin", "." > > I think this can be deduced by running /bin/sh as a login shell > with $PATH unset, and snarfing the output of "echo $PATH". Ssh (which also uses GNU autoconf) adds a special option to the autoconf generated configure script: --with-path=PATH Default path passed to user shell by sshd. (autoconf has an AC_ARG_WITH() macro to support such features....) > I am sorely tempted to remove named pipe support. It never worked > properly. So something is needed to auto-sense the particular > encoding for /dev/fd (systems encode this differently), which I > doubt is supplied by GNU autoconf. It would be sad to lose it, though of course if it doesn't wrok right (I admit I've not tried it in a very long time), > > #define DEFAULTINTERP "/bin/sh" > > Ditto, this should just be a standard feature. Though of course autoconf can tell for sure. (Note that many modern systems don't have a /bin directory, eg. SunOS-4 & 5, though of course they do usually have a symlink there pointing at /usr/bin) > > #define PROTECT_ENV > > Given that every /bin/sh I have tried croaks on rc-native environment > variable representation in some way or other, PROTECT_ENV should > be the only method for encoding env. variable names. What if DEFAULTINTERP isn't /bin/sh? ;-) -- Greg A. Woods +1 416 443-1734 VE3TCP robohack!woods Planix, Inc. ; Secrets of the Weird From rc-owner Tue Apr 1 23:35:50 1997 Received: from cse.psu.edu ([130.203.3.50]) by hawkwind.utcs.utoronto.ca with SMTP id <24651>; Tue, 1 Apr 1997 23:34:52 -0500 Received: from eiffel.cse.psu.edu (schwartz@eiffel.cse.psu.edu [130.203.10.16]) by cse.psu.edu (8.8.5/8.7.3) with ESMTP id VAA14000; Tue, 1 Apr 1997 21:20:42 -0500 (EST) Message-Id: <199704020220.VAA14000@cse.psu.edu> To: byron@netapp.com (Byron Rakitzis) cc: rc@hawkwind.utcs.toronto.edu Subject: Re: autoconfig In-reply-to: Your message of "Tue, 01 Apr 1997 14:28:39 EST." <9704011928.AA27920@netapp.com> Date: Tue, 1 Apr 1997 21:20:32 -0500 From: Scott Schwartz byron@netapp.com (Byron Rakitzis) writes: | > #define DEFAULTPATH "/usr/ucb", "/usr/bin", "/bin", "." | | I think this can be deduced by running /bin/sh as a login shell | with $PATH unset, and snarfing the output of "echo $PATH". I like adding /usr/local/bin to defaultpath, something /bin/sh doesn't do, because rc doesn't source .rcrc unless it is a login shell and more localized defaults makes rsh work better. | I am sorely tempted to remove named pipe support. It never worked | properly. But it works just barely well enough for SunOS, which has no /dev/fd (unless you install a nonstandard modloaded device, or override open().) | > #define NOJOB | | Does anyone use this? It forces sh-like semantics for backgrounding. | Why should it be an option? I haven't found a use for it, but I think | I put it in in self-defense early on. If anyone ever ports it to Plan 9, it might be handy. (I get an urge to do this every time I hit a feature that your shell does better than the original, most often multi line lists.) From rc-owner Tue Apr 1 23:35:52 1997 Received: from oldp.nmsu.edu ([128.123.26.31]) by hawkwind.utcs.utoronto.ca with SMTP id <24642>; Tue, 1 Apr 1997 23:33:46 -0500 Received: by oldp.nmsu.edu; id AA15931; Tue, 1 Apr 1997 16:52:37 -0700 Date: Tue, 1 Apr 1997 18:52:37 -0500 From: Alan Watson Message-Id: <9704012352.AA15931@oldp.nmsu.edu> To: byron@netapp.com Subject: Re: autoconfig Cc: rc@hawkwind.utcs.toronto.edu Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit > I am sorely tempted to remove named pipe support. It never worked > properly. I use it all the time (on Digital UNIX). It might not work properly, but it works well enough to be useful. Alan Watson From rc-owner Tue Apr 1 23:36:12 1997 Received: from elysium.uwa.edu.au ([130.95.128.2]) by hawkwind.utcs.utoronto.ca with SMTP id <24654>; Tue, 1 Apr 1997 23:35:19 -0500 Received: from typhaon.ucs.uwa.edu.au (luyer@typhaon.ucs.uwa.edu.au [130.95.128.64]) by elysium.uwa.edu.au (8.8.2/8.8.0) with SMTP id KAA01973; Wed, 2 Apr 1997 10:59:32 +0800 (WST) Date: Tue, 1 Apr 1997 21:59:32 -0500 From: David Luyer To: Byron Rakitzis cc: rc@hawkwind.utcs.toronto.edu Subject: Re: autoconfig In-Reply-To: <9704011928.AA27920@netapp.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Tue, 1 Apr 1997, Byron Rakitzis wrote: >My conclusion: It seems that rc + an autoconfig script could take >out all the configuration options. I don't see the point of going >with Posix, then. The main thing I think Posix has which would be nice/useful for portability is sigaction() - but even that isn't totally portable (SA_ONESHOT vs SA_RESETHAND vs OS's which assume one shot). David. From rc-owner Wed Apr 2 04:52:26 1997 Received: from faui45.informatik.uni-erlangen.de ([131.188.2.45]) by hawkwind.utcs.utoronto.ca with SMTP id <24648>; Wed, 2 Apr 1997 04:50:01 -0500 Received: from immd3.informatik.uni-erlangen.de (faui33.informatik.uni-erlangen.de [131.188.33.2]) by uni-erlangen.de with ESMTP id KAA17481 (8.7.6/7.5c-FAU); Wed, 2 Apr 1997 10:32:33 +0200 (MET DST) Received: (from dalibor@localhost) by immd3.informatik.uni-erlangen.de (8.8.5/8.8.5/evision: 1.9 $) id KAA06873; Wed, 2 Apr 1997 10:32:32 +0200 (MET DST) Message-Id: <199704020832.KAA06873@immd3.informatik.uni-erlangen.de> Date: Wed, 2 Apr 1997 03:32:32 -0500 From: Stefan Dalibor To: Byron Rakitzis Cc: rc@hawkwind.utcs.toronto.edu Subject: Re: autoconfig References: <9704011928.AA27920@netapp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.68e In-Reply-To: ; from Greg A. Woods on Tue, Apr 01, 1997 at 08:11:13PM -0500 On Tue, Apr 01, 1997 at 08:11:13PM -0500, Greg A. Woods wrote: > [ On Tue, April 1, 1997 at 14:28:39 (-0500), Byron Rakitzis wrote: ] > > Subject: autoconfig > > > > > #define DEFAULTPATH "/usr/ucb", "/usr/bin", "/bin", "." > > > > I think this can be deduced by running /bin/sh as a login shell > > with $PATH unset, and snarfing the output of "echo $PATH". This doesn't work for me (Solaris 2.5.1, DEC OSF/1 3.2) - sh just echoes nothing if started with PATH unset. There have to be default values compiled into the shell, but those are not echoed if $PATH is empty. On POSIX systems, there is the possibility of using confstr(_CS_PATH), (pdksh does that as far as I know) but I don't know wether/how the returned value is useful/configurable. I also vote for adding a special option to the configure script (as I'd like to add our instal- lation dependant local directories). In my opinion, support for named pipes should be continued - I use it quite often and it works fine for me. Bye, Stefan -- Stefan Dalibor - dalibor@immd3.informatik.uni-erlangen.de From rc-owner Wed Apr 2 04:52:41 1997 Received: from ankaret.damek.kth.se ([130.237.57.10]) by hawkwind.utcs.utoronto.ca with SMTP id <24654>; Wed, 2 Apr 1997 04:52:22 -0500 Received: (from bengtk@localhost) by ankaret.damek.kth.se (8.6.9/8.6.9) id LAA17494; Wed, 2 Apr 1997 11:38:59 +0200 Date: Wed, 2 Apr 1997 04:38:59 -0500 From: Bengt Kleberg Message-Id: <199704020938.LAA17494@ankaret.damek.kth.se> To: byron@netapp.com, rc@hawkwind.utcs.toronto.edu Subject: Re: autoconfig Content-Length: 241 > My conclusion: It seems that rc + an autoconfig script could take > out all the configuration options. I don't see the point of going > with Posix, then. Posix feels more "professional" than autoconfig. Perhaps I'm just very vain. Bengt From rc-owner Wed Apr 2 18:58:07 1997 Received: from pertsserver.cs.uiuc.edu ([128.174.247.69]) by hawkwind.utcs.utoronto.ca with SMTP id <24648>; Wed, 2 Apr 1997 18:56:04 -0500 Received: (from mkgardne@localhost) by pertsserver.cs.uiuc.edu (8.8.5/8.8.5) id IAA28138; Wed, 2 Apr 1997 08:37:43 -0600 (CST) Date: Wed, 2 Apr 1997 09:37:43 -0500 Message-Id: <199704021437.IAA28138@pertsserver.cs.uiuc.edu> From: "Mark K. Gardner" To: rc@hawkwind.utcs.toronto.edu Subject: Re: named pipe support (Was: autoconfig) Reply-to: mkgardne@cs.uiuc.edu [ On Tue, April 1, 1997 at 14:28:39 (-0500), Byron Rakitzis wrote: ] > I am sorely tempted to remove named pipe support. It never worked > properly. So something is needed to auto-sense the particular > encoding for /dev/fd (systems encode this differently), which I > doubt is supplied by GNU autoconf. I must confess that as a new user of RC, I have not made use of the named pipe feature. However, I have needed such a feature for a long time. (Now that I know it is there I will definitely try it out.) I would like to add my support for continuing the feature and fixing the problems. Which brings up my next question. What are the problems with named pipes as they are currently implemented? -- Mark K. Gardner (mkgardne@cs.uiuc.edu) University of Illinois at Urbana-Champaign Real-Time Systems Laboratory -- From rc-owner Wed Apr 2 18:58:34 1997 Received: from pertsserver.cs.uiuc.edu ([128.174.247.69]) by hawkwind.utcs.utoronto.ca with SMTP id <24649>; Wed, 2 Apr 1997 18:58:04 -0500 Received: (from mkgardne@localhost) by pertsserver.cs.uiuc.edu (8.8.5/8.8.5) id JAA28240; Wed, 2 Apr 1997 09:10:00 -0600 (CST) Date: Wed, 2 Apr 1997 10:10:00 -0500 Message-Id: <199704021510.JAA28240@pertsserver.cs.uiuc.edu> From: "Mark K. Gardner" To: byron@netapp.com, rc@hawkwind.utcs.toronto.edu In-reply-to: <199704020220.VAA14000@cse.psu.edu> (message from Scott Schwartz on Tue, 1 Apr 1997 21:20:32 -0500) Subject: Re: autoconfig Reply-to: mkgardne@cs.uiuc.edu >> Scott Schwartz writes: >> Byron Rakitzis writes: Byron> > #define DEFAULTPATH "/usr/ucb", "/usr/bin", "/bin", "." Byron> Byron> I think this can be deduced by running /bin/sh as a login shell Byron> with $PATH unset, and snarfing the output of "echo $PATH". Scott> I like adding /usr/local/bin to defaultpath, something /bin/sh Scott> doesn't do, because rc doesn't source .rcrc unless it is a Scott> login shell and more localized defaults makes rsh work better. Except that /usr/local/bin isn't completely standard. Our support department, in their infinite wisdom, has decided to use /local/bin instead. I like the idea (suggested by someone else) that there be an autoconfig option to set the default path. Generalizing: any setting which is not universally standard should not be hard-wired into the source (i.e., there should be an autoconfig option for it). To do otherwise would limit the portability of the code. As I see it, limiting portability is against the spirit of the upcoming release. (It would be easy to argue that there is no such thing as a universal standard in the unix world...suggesting that everything should be an option. This is where keen judgement is required. I defer to the sages among us for a definition of what is sufficiently universal.) Byron> I am sorely tempted to remove named pipe support. It never worked Byron> properly. Scott> But it works just barely well enough for SunOS, which has no Scott> /dev/fd (unless you install a nonstandard modloaded device, or Scott> override open().) It also seems to work for Solaris 2.5.1 (SunOS 5.51) which does provide /dev/fd, though I haven't tested it a lot. I would really like to see this feature continue. As I posted separately, I have dreamed of this feature for a long time and now that I have discovered that my favorite shell has it... Well, I would hate to give it up! -- Mark K. Gardner (mkgardne@cs.uiuc.edu) University of Illinois at Urbana-Champaign Real-Time Systems Laboratory -- From rc-owner Wed Apr 2 18:58:51 1997 Received: from odin.INS.CWRU.Edu ([129.22.8.102]) by hawkwind.utcs.utoronto.ca with SMTP id <24657>; Wed, 2 Apr 1997 18:58:23 -0500 Received: (chet@localhost) by odin.INS.CWRU.Edu (8.7.6+cwru/CWRU-2.3-ins) id LAA17441; Wed, 2 Apr 1997 11:42:51 -0500 (EST) (from chet) Date: Wed, 2 Apr 1997 11:32:03 -0500 From: Chet Ramey To: byron@netapp.com Subject: Re: autoconfig Cc: rc@hawkwind.utcs.toronto.edu Reply-To: chet@po.CWRU.Edu In-Reply-To: Message from byron@netapp.com of Tue, 1 Apr 1997 14:28:39 -0500 (id <9704011928.AA27920@netapp.com>) Message-ID: <9704021632.AA15443.SM@odin.INS.CWRU.Edu> Read-Receipt-To: chet@po.CWRU.Edu MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > I am sorely tempted to remove named pipe support. It never worked > properly. So something is needed to auto-sense the particular > encoding for /dev/fd (systems encode this differently), which I > doubt is supplied by GNU autoconf. Here is the test from bash's aclocal.m4 (the `local extensions' to autoconf). It handles /dev/fd and Linux's whacky /proc/self/fd, and it is easy enough to add more directory prefixes to the check. The bash code then checks whether a file in /dev/fd is specified and constructs the pathname to use with DEV_FD_PREFIX. The bash `test' code and the code that builds filenames for use in process substitution both use DEV_FD_PREFIX when HAVE_DEV_FD is defined. AC_DEFUN(BASH_CHECK_DEV_FD, [AC_MSG_CHECKING(whether /dev/fd is available) AC_CACHE_VAL(bash_cv_dev_fd, [if test -d /dev/fd && test -r /dev/fd/0; then bash_cv_dev_fd=standard elif test -d /proc/self/fd && test -r /proc/self/fd/0; then bash_cv_dev_fd=whacky else bash_cv_dev_fd=absent fi ]) AC_MSG_RESULT($bash_cv_dev_fd) if test $bash_cv_dev_fd = "standard"; then AC_DEFINE(HAVE_DEV_FD) AC_DEFINE(DEV_FD_PREFIX, "/dev/fd/") elif test $bash_cv_dev_fd = "whacky"; then AC_DEFINE(HAVE_DEV_FD) AC_DEFINE(DEV_FD_PREFIX, "/proc/self/fd/") fi ]) -- ``The lyf so short, the craft so long to lerne.'' - Chaucer Chet Ramey, Case Western Reserve University Internet: chet@po.CWRU.Edu From rc-owner Wed Apr 2 19:01:03 1997 Received: from weaver-gw.netapp.com ([198.95.224.2]) by hawkwind.utcs.utoronto.ca with SMTP id <24673>; Wed, 2 Apr 1997 18:59:17 -0500 Received: from netapp.com ([192.9.200.1]) by weaver.netapp.com with SMTP id <15957-124>; Wed, 2 Apr 1997 12:23:19 -0000 Received: by netapp.com (4.1/SMI-4.1) id AA25980; Wed, 2 Apr 97 12:24:39 PST Date: Wed, 2 Apr 1997 15:24:39 -0500 From: byron@netapp.com (Byron Rakitzis) Message-Id: <9704022024.AA25980@netapp.com> To: byron@netapp.com, schwartz@cse.psu.edu Subject: Re: autoconfig Cc: rc@hawkwind.utcs.toronto.edu >But it works just barely well enough for SunOS, which has no /dev/fd Ok, I'm convinced that people use named pipes w/rc! It will be no problem to leave it as-is. >| > #define NOJOB >| Does anyone use this? It forces sh-like semantics for backgrounding. >If anyone ever ports it to Plan 9, it might be handy. Well, NOJOB *forces* sh-like semantics for backgrounding, but those semantics are used by default when the SIGTT* signals are undefined: #if !defined(NOJOB) && defined(SIGTTOU) && defined(SIGTTIN) && defined(SIGTSTP) setsigdefaults(FALSE); [...] I'm asking whether anyone forces NOJOB on a job-control Unix. Byron. From rc-owner Wed Apr 2 19:01:09 1997 Received: from postman.osf.org ([130.105.1.152]) by hawkwind.utcs.utoronto.ca with SMTP id <24659>; Wed, 2 Apr 1997 18:58:44 -0500 Received: from sulphur.osf.org (sulphur.osf.org [130.105.1.123]) by postman.osf.org (8.7.6/8.7.3) with ESMTP id MAA07713; Wed, 2 Apr 1997 12:30:11 -0500 (EST) Received: (from rsalz@localhost) by sulphur.osf.org (8.7.5/8.7.3) id MAA01905; Wed, 2 Apr 1997 12:30:09 -0500 (EST) Date: Wed, 2 Apr 1997 12:30:09 -0500 From: Rich Salz Message-Id: <199704021730.MAA01905@sulphur.osf.org> To: bengtk@damek.kth.se, byron@netapp.com, rc@hawkwind.utcs.toronto.edu Subject: Re: autoconfig > Posix feels more "professional" than autoconfig. Perhaps I'm just very vain. It's not vain, just very silly. Until one standard is 100% of the "marketplace" that you wish to serve, then leveraging well-understood, succesful, tools like FSF's autoconf are the way to go. This is my experience based on having developed and released several software packages to the net at large. /r$ From rc-owner Wed Apr 2 21:52:54 1997 Received: from tweety.bhp.com.au ([192.83.224.130]) by hawkwind.utcs.utoronto.ca with SMTP id <24635>; Wed, 2 Apr 1997 21:49:28 -0500 Received: from gossamer.itmel.bhp.com.au (gossamer.itmel.bhp.com.au [134.18.115.254]) by tweety.bhp.com.au (8.8.4/8.8.4) with ESMTP id KAA06709; Thu, 3 Apr 1997 10:16:14 +1000 (EST) Received: from cerberus.bhpese.oz.au (cerberus.itntl.bhp.com.au [134.18.16.17]) by gossamer.itmel.bhp.com.au (8.8.4/8.8.4) with SMTP id KAA22009; Thu, 3 Apr 1997 10:15:40 +1000 (EST) Received: from nc.itntl.bhp.com.au (nc) by cerberus.bhpese.oz.au with SMTP id AA29101; Thu, 3 Apr 1997 10:15:28 +1000; sendmail 5.67a/Sm3.20RMPSU (from Sm@nc.bhpese.oz.au for bengtk@damek.kth.se) Received: from nc.itntl.bhp.com.au by nc.itntl.bhp.com.au with ESMTP id KAA05684; Thu, 3 Apr 1997 10:15:27 +1000; sendmail 8.6.10/Sm2.1sun (from Sm@nc.itntl.bhp.com.au for ) Message-Id: <199704030015.KAA05684@nc.itntl.bhp.com.au> To: Bengt Kleberg Cc: rc@hawkwind.utcs.toronto.edu Subject: Re: autoconfig In-Reply-To: Your message of "Wed, 02 Apr 1997 04:38:59 EST." <199704020938.LAA17494@ankaret.damek.kth.se> X-Face: '82~l%BnDBWVn])DV^cl_%bla$T]kNbRN&]>v{ED9[" > Posix feels more "professional" than autoconfig. Perhaps I'm just very vain. Professional is not necessarily functional, and can sometimes be equivalent to getting half the functionality at twice the price, and four times the frustration and aggravation. Posix isn't ubiquitous by any stretch of the imagination, and there will be legacy systems where people want to run rc for a long time to come. I've been making UNIX code work for over 10 years, and I'd rather see autoconf. Sm From rc-owner Thu Apr 3 05:57:47 1997 Received: from henry.cs.adfa.oz.au ([131.236.21.158]) by hawkwind.utcs.utoronto.ca with SMTP id <24637>; Thu, 3 Apr 1997 05:55:06 -0500 Received: (from wkt@localhost) by henry.cs.adfa.oz.au (8.7.5/8.7.3) id NAA25345 for rc@hawkwind.utcs.toronto.edu; Thu, 3 Apr 1997 13:14:21 +1000 (EST) From: Warren Toomey Message-Id: <199704030314.NAA25345@henry.cs.adfa.oz.au> Subject: Re: autoconfig To: rc@hawkwind.utcs.toronto.edu Date: Wed, 2 Apr 1997 22:14:21 -0500 In-Reply-To: <199704030015.KAA05684@nc.itntl.bhp.com.au> from Scott Merrilees at "Apr 2, 97 07:15:27 pm" X-Mailer: ELM [version 2.4ME+ PL22 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit > Posix feels more "professional" than autoconfig. Perhaps I'm just very vain. My $0.02. I'd be happy with autoconfig, for the same reasons that Rich Salz gave. Warren From rc-owner Thu Apr 3 17:43:09 1997 Received: from kissimmee.infomkt.ibm.com ([204.146.129.20]) by hawkwind.utcs.utoronto.ca with SMTP id <24641>; Thu, 3 Apr 1997 17:40:38 -0500 Received: from dingler.dev.infomkt.ibm.com (dingler.dev.infomkt.ibm.com [204.146.132.31]) by kissimmee.infomkt.ibm.com (8.6.10/8.6.10) with ESMTP id HAA16498 for ; Thu, 3 Apr 1997 07:45:04 -0500 Received: (from quanstro@localhost) by dingler.dev.infomkt.ibm.com (8.7.5/8.7.3) id HAA30478 for rc@hawkwind.utcs.toronto.edu; Thu, 3 Apr 1997 07:48:53 -0500 Date: Thu, 3 Apr 1997 07:48:53 -0500 Message-Id: <199704031248.HAA30478@dingler.dev.infomkt.ibm.com> To: rc@hawkwind.utcs.toronto.edu From: erik quanstrom Subject: NOJOB >I'm asking whether anyone forces NOJOB on a job-control Unix. i do. twisted, no? From rc-owner Sat Apr 5 14:38:56 1997 Received: from ankaret.damek.kth.se ([130.237.57.10]) by hawkwind.utcs.utoronto.ca with SMTP id <24656>; Sat, 5 Apr 1997 14:36:37 -0500 Received: (from bengtk@localhost) by ankaret.damek.kth.se (8.6.9/8.6.9) id UAA04460; Sat, 5 Apr 1997 20:38:42 +0200 Date: Sat, 5 Apr 1997 13:38:42 -0500 From: Bengt Kleberg Message-Id: <199704051838.UAA04460@ankaret.damek.kth.se> To: rc@hawkwind.utcs.toronto.edu, wkt@henry.cs.adfa.oz.au Subject: Re: autoconfig Content-Length: 649 Greetings, Since it is a very large majority for autoconfig (and some gentle remarks about my wrongfull interest in Posix :-) I can only add that I belive that one Posix is better than several other "standards" _at the same time_. One by one the others might be "better", but it is their multitude that makes me pine for Posix. OK? Best Wishes, Bengt =============================================================== Everything aforementioned should be regarded as totally private opinions, and nothing else. bengtk@damek.kth.se ``His great strength is that he is uncompromising. It would make him physically ill to think of programming in C++.'' From rc-owner Wed Apr 30 21:14:19 1997 Received: from mail.clark.net ([168.143.0.10]) by hawkwind.utcs.utoronto.ca with SMTP id <24656>; Wed, 30 Apr 1997 21:12:09 -0400 Received: from clark.net (culliton@explorer.clark.net [168.143.0.7]) by mail.clark.net (8.8.5/8.6.5) with ESMTP id SAA11014; Wed, 30 Apr 1997 18:26:20 -0400 (EDT) From: Tom Culliton Received: (from culliton@localhost) by clark.net (8.8.5/8.7.1) id SAA03968; Wed, 30 Apr 1997 18:26:40 -0400 (EDT) Date: Wed, 30 Apr 1997 18:26:40 -0400 Message-Id: <199704302226.SAA03968@clark.net> To: TimTroyR@ionet.net, rc@hawkwind.utcs.toronto.edu Subject: 99 bottles in an rc shell script. I was feeling a bit whimsical after a friend pointed out the "99 bottles of beer on the wall" page and since there was already a version in python, rc (the Plan 9 shell) was my next choice. ;-) Anyone on the rc list want to try for an improved version? This one was done strictly with builtins. Using expr you could get rid of the count list and other uglyness. Anyone have other major improvements? ;-) ;-) ;-) Tom #!/usr/local/bin/rc # rc shell version of 99 bottles of beer # by Tom Culliton (culliton@clark.net) count = (99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1) bottles = bottles; one = one for (i in $count) { if (~ $i 1) {bottles = bottle; one = it} if (! ~ $i 99) { echo $i $bottles 'of beer on the wall.' echo } echo $i $bottles 'of beer on the wall,' echo $i $bottles 'of beer,' echo 'take' $one 'down and pass it around,' } echo 'no more bottles of beer on the wall!' From rc-owner Thu May 1 02:47:06 1997 Received: from plan9.research.att.com ([135.205.33.187]) by hawkwind.utcs.utoronto.ca with SMTP id <24649>; Thu, 1 May 1997 02:46:22 -0400 From: rsc@research.att.com Date: Wed, 30 Apr 1997 21:29:52 -0400 To: culliton@clark.net, rc@hawkwind.utcs.toronto.edu Subject: re: 99 bottles in an rc shell script. Message-Id: <97May1.024622edt.24649@hawkwind.utcs.utoronto.ca> This introduces a little more code in return for losing the count array. #!/bin/rc # rc shell version of 99 bottles of beer # by Tom Culliton (culliton@clark.net) # revised by Russ Cox (rsc@research.att.com) bottles = bottles; one = one digits = (9 8 7 6 5 4 3 2 1 0) for(i in $digits) for(j in $digits) { n = $i$j if(~ $i 0) n = $j if(! ~ $n 0) { if(~ $n 1) { bottles = bottle; one = it } if(! ~ $n 99) { echo $n $bottles 'of beer on the wall.' echo } echo $n $bottles 'of beer on the wall,' echo $n $bottles 'of beer,' echo 'take' $one 'down and pass it around,' } } echo 'no more bottles of beer on the wall!' From rc-owner Thu May 1 02:47:27 1997 Received: from plan9.research.att.com ([135.205.33.187]) by hawkwind.utcs.utoronto.ca with SMTP id <24650>; Thu, 1 May 1997 02:47:02 -0400 From: rsc@research.att.com To: rc@hawkwind.utcs.toronto.edu Date: Wed, 30 Apr 1997 21:39:07 -0400 Subject: beer bottles Message-Id: <97May1.024702edt.24650@hawkwind.utcs.utoronto.ca> a slightly better version #!/bin/rc # rc shell version of 99 bottles of beer # by Tom Culliton (culliton@clark.net) # revised by Russ Cox (rsc@research.att.com) bottles = bottles; one = one digits = (9 8 7 6 5 4 3 2 1) for(i in $digits '') for(j in $digits 0) { n = $i$j if(! ~ $n 0) { if(~ $n 1) { bottles = bottle; one = it } if(! ~ $n 99) { echo $n $bottles 'of beer on the wall.' echo } echo $n $bottles 'of beer on the wall,' echo $n $bottles 'of beer,' echo 'take' $one 'down and pass it around,' } } From rc-owner Thu May 1 02:49:21 1997 Received: from mail.clark.net ([168.143.0.10]) by hawkwind.utcs.utoronto.ca with SMTP id <24666>; Thu, 1 May 1997 02:47:43 -0400 Received: from explorer2.clark.net (culliton@explorer2.clark.net [168.143.0.5]) by mail.clark.net (8.8.5/8.6.5) with ESMTP id AAA19258; Thu, 1 May 1997 00:02:52 -0400 (EDT) From: Tom Culliton Received: (from culliton@localhost) by explorer2.clark.net (8.8.5/8.7.1) id AAA16372; Thu, 1 May 1997 00:03:12 -0400 (EDT) Date: Thu, 1 May 1997 00:03:12 -0400 Message-Id: <199705010403.AAA16372@explorer2.clark.net> To: culliton@clark.net, luyer@ucs.uwa.edu.au Cc: TimTroyR@ionet.net, rc@hawkwind.utcs.toronto.edu Subject: Re: 99 bottles in an rc shell script. Good idea, but your awk could be simpler... > for(i in `{awk '{BEGIN{for(i=99;i>0;i--){print i;};exit;}'}) { for (i in `{awk 'BEGIN{for(i=99;i>0;i--)print i}'}) { I still like the version done strictly with builtins myself. ;-) From rc-owner Thu May 1 02:49:27 1997 Received: from mail.clark.net ([168.143.0.10]) by hawkwind.utcs.utoronto.ca with SMTP id <24668>; Thu, 1 May 1997 02:48:06 -0400 Received: from explorer2.clark.net (culliton@explorer2.clark.net [168.143.0.5]) by mail.clark.net (8.8.5/8.6.5) with ESMTP id BAA03439; Thu, 1 May 1997 01:02:27 -0400 (EDT) From: Tom Culliton Received: (from culliton@localhost) by explorer2.clark.net (8.8.5/8.7.1) id BAA29092; Thu, 1 May 1997 01:02:48 -0400 (EDT) Date: Thu, 1 May 1997 01:02:48 -0400 Message-Id: <199705010502.BAA29092@explorer2.clark.net> To: culliton@clark.net, rc@hawkwind.utcs.toronto.edu, rsc@research.att.com Subject: re: 99 bottles in an rc shell script. > This introduces a little more code in return for > losing the count array. > > #!/bin/rc > # rc shell version of 99 bottles of beer > # by Tom Culliton (culliton@clark.net) > # revised by Russ Cox (rsc@research.att.com) > > bottles = bottles; one = one > digits = (9 8 7 6 5 4 3 2 1 0) > for(i in $digits) for(j in $digits) { > n = $i$j > if(~ $i 0) n = $j > if(! ~ $n 0) { > if(~ $n 1) { bottles = bottle; one = it } > if(! ~ $n 99) { > echo $n $bottles 'of beer on the wall.' > echo > } > echo $n $bottles 'of beer on the wall,' > echo $n $bottles 'of beer,' > echo 'take' $one 'down and pass it around,' > } > } > echo 'no more bottles of beer on the wall!' This reminds me of an even more "rc like" way to do this with just builtins... ;-) ;-) ;-) ten = (beer beer beer beer beer beer beer beer beer beer) * = ($ten $ten $ten $ten $ten $ten $ten $ten $ten $ten) shift ; bottles = $#*^' bottles' ; one = one while (! ~ $* ()) { echo $bottles 'of beer on the wall,' ; echo $bottles 'of beer,' echo 'take' $one 'down and pass it around,' shift ; switch ($#*) { case 1 ; bottles = '1 bottle' ; one = it case 0 ; bottles = 'no more bottles' case * ; bottles = $#*^' bottles' } echo $bottles 'of beer on the wall.' ; echo } From rc-owner Thu May 1 02:50:18 1997 Received: from elysium.uwa.edu.au ([130.95.128.2]) by hawkwind.utcs.utoronto.ca with SMTP id <24655>; Thu, 1 May 1997 02:47:17 -0400 Received: from typhaon.ucs.uwa.edu.au (luyer@typhaon.ucs.uwa.edu.au [130.95.128.64]) by elysium.uwa.edu.au (8.8.2/8.8.0) with SMTP id JAA21236; Thu, 1 May 1997 09:57:03 +0800 (WST) Date: Wed, 30 Apr 1997 21:57:03 -0400 From: David Luyer To: Tom Culliton cc: TimTroyR@ionet.net, rc@hawkwind.utcs.toronto.edu Subject: Re: 99 bottles in an rc shell script. In-Reply-To: <199704302226.SAA03968@clark.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Wed, 30 Apr 1997, Tom Culliton wrote: >#!/usr/local/bin/rc ># rc shell version of 99 bottles of beer ># by Tom Culliton (culliton@clark.net) > >count = (99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 > 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 > 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 > 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 > 11 10 9 8 7 6 5 4 3 2 1) ^^^^^^^^^^^ scrap this... >bottles = bottles; one = one >for (i in $count) { for(i in `{awk '{BEGIN{for(i=99;i>0;i--){print i;};exit;}'}) { > if (~ $i 1) {bottles = bottle; one = it} > if (! ~ $i 99) { > echo $i $bottles 'of beer on the wall.' > echo > } > echo $i $bottles 'of beer on the wall,' > echo $i $bottles 'of beer,' > echo 'take' $one 'down and pass it around,' >} >echo 'no more bottles of beer on the wall!' From rc-owner Thu May 1 17:05:57 1997 Received: from netcom9.netcom.com ([192.100.81.119]) by hawkwind.utcs.utoronto.ca with SMTP id <24710>; Thu, 1 May 1997 16:59:18 -0400 Received: (from haahr@localhost) by netcom9.netcom.com (8.6.13/Netcom) id JAA16436; Thu, 1 May 1997 09:33:37 -0700 Date: Thu, 1 May 1997 12:33:37 -0400 From: haahr@netcom.com (Paul Haahr) Message-Id: <199705011633.JAA16436@netcom9.netcom.com> To: Tom Culliton Cc: TimTroyR@ionet.net, rc@hawkwind.utcs.toronto.edu Subject: Re: 99 bottles in an rc shell script. In-Reply-To: <199704302226.SAA03968@clark.net> References: <199704302226.SAA03968@clark.net> Why enumerate all the numbers? Why use some external program? Peano arithmetic is more than sufficient. (While I was at it, I rearranged the loop a little. And I didn't use the elseif constructs because I wanted compatibility between Byron's rc and Plan 9 rc, as well as forgetting what they are.) #! /usr/local/bin/rc * = 0 while (! ~ $#* 100) * = ($#* $*) bottles = bottles one = one punct = . while (true) { echo $1 $bottles of beer on the wall, echo $1 $bottles of beer, echo take $one down and pass it around, shift if (~ $1 1) { bottles = bottle one = it } count = ($1 $one) if (~ $1 0) { count = (no more) bottle = bottles punct = ! } echo $count $bottles of beer on the wall^$punct if (~ $1 0) break echo } From rc-owner Thu May 1 17:06:37 1997 Received: from mail.clark.net ([168.143.0.10]) by hawkwind.utcs.utoronto.ca with SMTP id <24723>; Thu, 1 May 1997 17:02:59 -0400 Received: from clark.net (culliton@explorer.clark.net [168.143.0.7]) by mail.clark.net (8.8.5/8.6.5) with ESMTP id NAA28533; Thu, 1 May 1997 13:14:35 -0400 (EDT) From: Tom Culliton Received: (from culliton@localhost) by clark.net (8.8.5/8.7.1) id NAA07547; Thu, 1 May 1997 13:14:56 -0400 (EDT) Date: Thu, 1 May 1997 13:14:56 -0400 Message-Id: <199705011714.NAA07547@clark.net> To: culliton@clark.net, haahr@netcom.com Cc: TimTroyR@ionet.net, rc@hawkwind.utcs.toronto.edu Subject: Re: 99 bottles in an rc shell script. > Why enumerate all the numbers? Why use some external program? Peano > arithmetic is more than sufficient. True, but the way you did it also takes an extra loop. However I was thinking about using it to generate the output backwards, inserting each line at the head of the list, then echoing the whole list at once. 8-o Fortunately it was late and I went to bed before try that. ;-) Tom From rc-owner Thu May 1 17:07:14 1997 Received: from weaver-gw.netapp.com ([198.95.224.2]) by hawkwind.utcs.utoronto.ca with SMTP id <24740>; Thu, 1 May 1997 17:04:32 -0400 Received: from netapp.com ([192.9.200.1]) by weaver.netapp.com with SMTP id <246204-184>; Thu, 1 May 1997 12:26:46 -0700 Received: by netapp.com (4.1/SMI-4.1) id AA28377; Thu, 1 May 97 12:28:23 PDT Date: Thu, 1 May 1997 15:28:23 -0400 From: byron@netapp.com (Byron Rakitzis) Message-Id: <9705011928.AA28377@netapp.com> To: culliton@clark.net, rc@hawkwind.utcs.toronto.edu, rsc@research.att.com Subject: re: 99 bottles in an rc shell script. How about this way to build a list up: #!/bin/rc fn stack_bottles { count=$1 if (~ $count *[~0-9]* || ~ $count ()) { echo $0: count must be a nonnegative decimal integer >[1=2] exit 1 } bottles=() while (!~ $#bottles $count) bottles=(beer $bottles) echo $bottles } # the rest is cribbed from tom *=`{stack_bottles $*} bottles=$#* one=one while (!~ $#* 0) { echo $bottles 'of beer on the wall,' ; echo $bottles 'of beer,' echo 'take' $one 'down and pass it around,' shift ; switch ($#*) { case 1 ; bottles = '1 bottle' ; one = it case 0 ; bottles = 'no more bottles' case * ; bottles = $#*^' bottles' } echo $bottles 'of beer on the wall.' ; echo } From rc-owner Thu May 1 21:19:20 1997 Received: from mail.clark.net ([168.143.0.10]) by hawkwind.utcs.utoronto.ca with SMTP id <24653>; Thu, 1 May 1997 21:17:24 -0400 Received: from clark.net (culliton@explorer.clark.net [168.143.0.7]) by mail.clark.net (8.8.5/8.6.5) with ESMTP id RAA11658 for ; Thu, 1 May 1997 17:39:50 -0400 (EDT) From: Tom Culliton Received: (from culliton@localhost) by clark.net (8.8.5/8.7.1) id RAA07113 for rc@hawkwind.utcs.toronto.edu; Thu, 1 May 1997 17:40:10 -0400 (EDT) Date: Thu, 1 May 1997 17:40:10 -0400 Message-Id: <199705012140.RAA07113@clark.net> To: rc@hawkwind.utcs.toronto.edu Subject: Speaking of counting... Does anyone have a nice little generic range function for rc? The type of thing that lets generate a list something like the indices from a fortran or basic for statement. (I'm actually modelling this after the one in python.) 1 argument means for (i = 0; i < $1; i += 1) 2 arguments mean for (i = $1; i < $2; i += 1) 3 arguments mean for (i = $1; ($3 > 0 && i < $2) || ($3 > 0 && i > $2; i += $3) For example... # echo 99 down to but not including 0 for (i in `{range 99 0 -1}) echo $i # echo 0 up to but not including 10 for (i in `{range 0 10}) echo $i # echo 0 up to but not including 10 stepping 2 for (i in `{range 0 10 2}) echo $i # echo 0 up to but not including 10 for (i in `{range 10}) echo $i I could whip something up using awk, but someone must already have one! Tom From rc-owner Thu May 1 21:19:47 1997 Received: from pertsserver.cs.uiuc.edu ([128.174.247.69]) by hawkwind.utcs.utoronto.ca with SMTP id <24658>; Thu, 1 May 1997 21:19:02 -0400 Received: (from mkgardne@localhost) by pertsserver.cs.uiuc.edu (8.8.5/8.8.5) id QAA09988; Thu, 1 May 1997 16:13:39 -0500 (CDT) Date: Thu, 1 May 1997 17:13:39 -0400 Message-Id: <199705012113.QAA09988@pertsserver.cs.uiuc.edu> From: "Mark K. Gardner" To: rc@hawkwind.utcs.toronto.edu Subject: re: 99 bottles in an rc shell script. Reply-to: mkgardne@cs.uiuc.edu I had to join in the fun (even though I don't drink beer). This one not only drinks beer, it also eats CPU. (You get a test mode free of charge by typing "beer ". It may or may not use builtins exclusively... depending on your philosophy.) -- Mark K. Gardner (mkgardne@cs.uiuc.edu) University of Illinois at Urbana-Champaign Real-Time Systems Laboratory -- === File: beer === #!/bin/rc # rc shell version of 99 bottles of beer # by Tom Culliton (culliton@clark.net) # revised by Mark Gardner (mkgardne@cs.uiuc.edu) # Supply the path to this script... again = `{pwd}^/beer if (~ $#* 0) { count = 99 } else { count = $1 } bottles = bottles; one = one if (! ~ $count 0) { if (~ $count 1) {bottles = bottle; one = it} if (! ~ $count 99) { echo $count $bottles 'of beer on the wall.' echo } echo $count $bottles 'of beer on the wall,' echo $count $bottles 'of beer,' echo 'take' $one 'down and pass it around,' $again `{expr $count - 1} } else { echo 'no more bottles of beer on the wall!' } From rc-owner Fri May 2 00:17:55 1997 Received: from cse.psu.edu ([130.203.3.50]) by hawkwind.utcs.utoronto.ca with SMTP id <24649>; Fri, 2 May 1997 00:17:17 -0400 Received: from eiffel.cse.psu.edu (schwartz@eiffel.cse.psu.edu [130.203.10.16]) by cse.psu.edu (8.8.5/8.7.3) with ESMTP id VAA10527; Thu, 1 May 1997 21:25:16 -0400 (EDT) Message-Id: <199705020125.VAA10527@cse.psu.edu> To: Tom Culliton cc: rc@hawkwind.utcs.toronto.edu Subject: Re: Speaking of counting... In-reply-to: Your message of "Thu, 01 May 1997 17:40:10 EDT." <199705012140.RAA07113@clark.net> Date: Thu, 1 May 1997 21:26:31 -0400 From: Scott Schwartz Tom Culliton writes: | Does anyone have a nice little generic range function for rc? In Plan 9 it's named "seq". I've been using this approximation: #!/bin/perl require 'getopts.pl'; $opt_f = "%g\n"; do Getopts('f:'); if ($#ARGV == 2) { $start = $ARGV[0]; $step = $ARGV[1]; $end = $ARGV[2]; } elsif ($#ARGV == 1) { $start = $ARGV[0]; $step = 1; $end = $ARGV[1]; } elsif ($#ARGV == 0) { $start = 1; $step = 1; $end = $ARGV[0]; } else { die "usage: [-f fmt] [start [step]] end\n"; } $opt_f =~ s/["`\$\@]/\\$&/g; for ($n = $start; $n <= $end; $n += $step) { eval 'printf "' . $opt_f . '", $n'; } From rc-owner Fri May 2 00:18:08 1997 Received: from melange.gnu.ai.mit.edu ([128.52.46.66]) by hawkwind.utcs.utoronto.ca with SMTP id <24650>; Fri, 2 May 1997 00:17:52 -0400 Received: by melange.gnu.ai.mit.edu (8.8.5/8.6.12GNU) id WAA09438; Thu, 1 May 1997 22:44:53 -0400 (EDT) To: Tom Culliton Cc: rc@hawkwind.utcs.toronto.edu Subject: Re: Speaking of counting... References: <199705012140.RAA07113@clark.net> From: mycroft@gnu.ai.mit.edu (Charles M. Hannum) Date: Thu, 1 May 1997 22:44:46 -0400 In-Reply-To: Tom Culliton's message of Thu, 1 May 1997 17:40:10 -0400 Message-ID: Lines: 9 X-Mailer: Gnus v5.3/Emacs 19.34 Tom Culliton writes: > > Does anyone have a nice little generic range function for rc? If you're going to do this, please at least use the same interface as something that already exists -- for example, the BSD jot(1) program. From rc-owner Fri May 2 00:18:34 1997 Received: from postman.osf.org ([130.105.1.152]) by hawkwind.utcs.utoronto.ca with SMTP id <24662>; Fri, 2 May 1997 00:18:12 -0400 Received: from sulphur.osf.org (sulphur.osf.org [130.105.1.123]) by postman.osf.org (8.7.6/8.7.3) with ESMTP id XAA32000; Thu, 1 May 1997 23:30:07 -0400 (EDT) Received: (from rsalz@localhost) by sulphur.osf.org (8.7.5/8.7.3) id XAA21915; Thu, 1 May 1997 23:30:04 -0400 (EDT) Date: Thu, 1 May 1997 23:30:04 -0400 From: Rich Salz Message-Id: <199705020330.XAA21915@sulphur.osf.org> To: culliton@clark.net, rc@hawkwind.utcs.toronto.edu Subject: Re: Speaking of counting... Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit I remember an old bsd4.2 "contrib" command called jot that did this kind of thing. From rc-owner Fri May 2 05:13:24 1997 Received: from cse.psu.edu ([130.203.3.50]) by hawkwind.utcs.utoronto.ca with SMTP id <24655>; Fri, 2 May 1997 05:09:05 -0400 Received: from eiffel.cse.psu.edu (schwartz@eiffel.cse.psu.edu [130.203.10.16]) by cse.psu.edu (8.8.5/8.7.3) with ESMTP id BAA15148 for ; Fri, 2 May 1997 01:51:08 -0400 (EDT) Message-Id: <199705020551.BAA15148@cse.psu.edu> to: rc@hawkwind.utcs.toronto.edu Subject: Re: Speaking of counting... In-reply-to: Your message of "Thu, 01 May 1997 22:44:46 EDT." Date: Fri, 2 May 1997 01:52:24 -0400 From: Scott Schwartz mycroft@gnu.ai.mit.edu (Charles M. Hannum) writes: | If you're going to do this, please at least use the same interface as | something that already exists -- for example, the BSD jot(1) program. Well, as long as rc ships with Plan 9, but not with BSD, we should call it what Plan 9 does. :-) From rc-owner Fri May 2 17:34:04 1997 Received: from loverso.southborough.ma.us ([130.105.7.200]) by hawkwind.utcs.utoronto.ca with SMTP id <24674>; Fri, 2 May 1997 17:28:16 -0400 Received: from localhost.loverso.southborough.ma.us (localhost.loverso.southborough.ma.us [127.0.0.1]) by loverso.southborough.ma.us (8.7.5/8.6.9) with SMTP id KAA08255; Fri, 2 May 1997 10:51:25 -0400 (EDT) Message-Id: <199705021451.KAA08255@loverso.southborough.ma.us> X-Authentication-Warning: loverso.southborough.ma.us: Host localhost.loverso.southborough.ma.us [127.0.0.1] didn't use HELO protocol To: Rich Salz Cc: rc@hawkwind.utcs.toronto.edu Subject: Re: Speaking of counting... In-reply-to: Message from Rich Salz <199705020330.XAA21915@sulphur.osf.org> . X-Face: "UZ!}1W2N?eJdN(`1%|/OOPqJ).Idk?UyvWw'W-%`Gto8^IkEm>.g1O$[.;~}8E=Ire0|lO .o>:NlJS1@vO9bVmswRoq3j DdX9YGSeJ5a(mfX[1u>Z63G5_^+'8LVqjqvn X-Url: http://www.osf.org/~loverso/ Date: Fri, 2 May 1997 10:51:25 -0400 From: John Robert LoVerso jot has been in /usr/bin since 4.4BSD. John From rc-owner Fri May 2 19:48:53 1997 Received: from mail.clark.net ([168.143.0.10]) by hawkwind.utcs.utoronto.ca with SMTP id <24662>; Fri, 2 May 1997 19:45:47 -0400 Received: from clark.net (culliton@explorer.clark.net [168.143.0.7]) by mail.clark.net (8.8.5/8.6.5) with ESMTP id SAA17772; Fri, 2 May 1997 18:08:51 -0400 (EDT) From: Tom Culliton Received: (from culliton@localhost) by clark.net (8.8.5/8.7.1) id SAA16770; Fri, 2 May 1997 18:09:14 -0400 (EDT) Date: Fri, 2 May 1997 18:09:14 -0400 Message-Id: <199705022209.SAA16770@clark.net> To: rc@hawkwind.utcs.toronto.edu Cc: john@loverso.southborough.ma.us, rsalz@osf.org Subject: Re: Speaking of counting... So far jot and seq have been mentioned, (every machine I have available says "jot not found" though... and ditto seq) but no specifics, I have been accused of wanting to reinventing the wheel, (exactly what I was trying to avoid) Scott has shared some perl code, (Euw! The evil anit-rc!) ;-) (Thank you.) I swear I've seen this in rc/awk before... From rc-owner Sat May 3 14:35:48 1997 Received: from weaver-gw.netapp.com ([198.95.224.2]) by hawkwind.utcs.utoronto.ca with SMTP id <24649>; Sat, 3 May 1997 14:33:06 -0400 Received: from netapp.com ([192.9.200.1]) by weaver.netapp.com with SMTP id <246213-189>; Sat, 3 May 1997 00:55:47 -0700 Received: by netapp.com (4.1/SMI-4.1) id AA15487; Sat, 3 May 97 00:57:30 PDT Date: Sat, 3 May 1997 03:57:30 -0400 From: byron@netapp.com (Byron Rakitzis) Message-Id: <9705030757.AA15487@netapp.com> To: culliton@clark.net, rc@hawkwind.utcs.toronto.edu Subject: Re: Speaking of counting... Cc: john@LoVerso.Southborough.MA.US, rsalz@osf.org Here's my version of seq: #!/bin/rc switch ($#*) { case 1 lo=1; hi=$1; incr=1 case 2 lo=$1; hi=$2; incr=1 case 3 lo=$1; hi=$2; incr=$3; case * echo 'usage: seq [ lo ] hi [ incr ]' >[1=2]; exit 1 } awk 0) { for (i = '$lo'; i <= '$hi'; i += '$incr') print i } else { for (i = '$lo'; i >= '$hi'; i += '$incr') print i } }' It's possible that I got this from Paul Haahr (or someone else for that matter --- I know my input-less awk scripts do all their work in the BEGIN clause), and I don't have my plan9 manuals with me in Europe so I have no idea if it matches up with plan9 seq. From rc-owner Sat May 3 14:37:15 1997 Received: from plan9.research.att.com ([135.205.33.187]) by hawkwind.utcs.utoronto.ca with SMTP id <24660>; Sat, 3 May 1997 14:35:48 -0400 From: rsc@research.att.com Date: Sat, 3 May 1997 08:43:33 -0400 To: culliton@clark.net, rc@hawkwind.utcs.toronto.edu Subject: Re: Speaking of counting... Message-Id: <97May3.143548edt.24660@hawkwind.utcs.utoronto.ca> #!/bin/rc first=0 last=0 incr=0 switch($#*) { case 0 echo 'Usage: $0 [first [incr]] last' exit 1 case 1 last=$1 case 2 first=$1 last=$2 case 3 first=$1 incr=$2 last=$3 } awk -v 'first='$first -v 'last='$last -v 'incr='$incr 'BEGIN{ if(incr == 0) incr = 1; if(first == 0) first = 1; for(i = first; i <= last; i += incr) print i; }' ------ forwarded message follows ------ >From hawkwind.utcs.toronto.edu!rc-owner Fri May 2 19:49:49 EDT 1997 Received: from corona.research.att.com by plan9; Fri May 2 19:49:49 EDT 1997 Received: from research.att.com (research.research.att.com [135.205.32.20]) by corona.research.att.com (8.7.5/8.7) with SMTP id TAA29692 for ; Fri, 2 May 1997 19:50:01 -0400 (EDT) Received: from hawkwind.utcs.utoronto.ca ([128.100.102.51]) by research; Fri May 2 19:48:54 EDT 1997 Received: from mail.clark.net ([168.143.0.10]) by hawkwind.utcs.utoronto.ca with SMTP id <24662>; Fri, 2 May 1997 19:45:47 -0400 Received: from clark.net (culliton@explorer.clark.net [168.143.0.7]) by mail.clark.net (8.8.5/8.6.5) with ESMTP id SAA17772; Fri, 2 May 1997 18:08:51 -0400 (EDT) From: Tom Culliton Received: (from culliton@localhost) by clark.net (8.8.5/8.7.1) id SAA16770; Fri, 2 May 1997 18:09:14 -0400 (EDT) Date: Fri, 2 May 1997 18:09:14 -0400 Message-Id: <199705022209.SAA16770@clark.net> To: hawkwind.utcs.toronto.edu!rc Cc: LoVerso.Southborough.MA.US!john, osf.org!rsalz Subject: Re: Speaking of counting... So far jot and seq have been mentioned, (every machine I have available says "jot not found" though... and ditto seq) but no specifics, I have been accused of wanting to reinventing the wheel, (exactly what I was trying to avoid) Scott has shared some perl code, (Euw! The evil anit-rc!) ;-) (Thank you.) I swear I've seen this in rc/awk before... From rc-owner Mon Jul 7 15:51:12 1997 Received: from quay.pipex.net ([158.43.128.34]) by hawkwind.utcs.utoronto.ca with SMTP id <24687>; Mon, 7 Jul 1997 15:40:43 -0400 Received: (qmail 24155 invoked from network); 7 Jul 1997 16:22:16 -0000 Received: from pool.uunet.pipex.com (158.43.134.17) by quay.uunet.pipex.com with QMTP; 7 Jul 1997 16:22:16 -0000 To: rc@hawkwind.utcs.toronto.edu Subject: Announcing rc beta release, rc-1.5b2 Date: Mon, 7 Jul 1997 12:22:14 -0400 From: Tim Goodwin Message-ID: I am pleased to announce, at long last, the second beta release of rc-1.5, which I'm calling rc-1.5b2. ftp://ftp.pipex.net/people/tim/rc-1.5b2.tar.gz ftp://ftp.pipex.net/people/tim/rc-1.5b2.tar MD5 (rc-1.5b2.tar.gz) = 4acc56de6a5595e4fd3f26c84856e699 MD5 (rc-1.5b2.tar) = 95453647e15018e9f37742dea4594138 The big difference from rc-1.5betadev1 is the use of GNU autoconf. All system specifics that rc needs to know about are automatically detected, and optional features (e.g. omitting the `echo' builtin) can be selected on the command line when the `configure' script is run. The looping bug with Solaris's rshd (and anything else that sets SIGCLD to SIG_IGN before starting rc) has been fixed. Because of the length of time that has passed since the last release, I haven't tried too hard to track down all the bugs reported on the list. I felt it was more important to get a "baseline" autoconf'd rc out. Apologies if this means that a bug you reported hasn't been fixed. I will endeavour to fix any outstanding bugs as quickly as possible, so please let me know of any problems you find. (Reports of successes would be welcome also.) Thanks to Byron for his patient guidance. Thanks also to Rich $alz for sending me the latest version of the editline library, which you can find in the same directory as the rc tarball. (Does anybody have a copy of Tom Duff's UKUUG paper? The README advertizes that this is available from the same place as rc itself...) Finally, please note that I am changing jobs very shortly. From 28th July 1997, my email address will be . Tim. From rc-owner Mon Jul 7 19:49:29 1997 Received: from localhost by hawkwind.utcs.utoronto.ca with SMTP id <23980>; Mon, 7 Jul 1997 19:48:23 -0400 To: rc Subject: Re: Announcing rc beta release, rc-1.5b2 In-reply-to: tim's message of Mon, 07 Jul 1997 12:22:14 -0400. Date: Mon, 7 Jul 1997 19:48:06 -0400 From: Chris Siebenmann Message-Id: <97Jul7.194823edt.23980@hawkwind.utcs.utoronto.ca> Tom Duff's UKUUG paper on rc is available on the main rc ftp site, at ftp.sys.utoronto.ca in /pub/rc; it's called plan9.ps. If people have things that they want to pop up on the ftp site, send me mail about it and I'll make it happen. - cks From rc-owner Tue Aug 12 05:12:02 1997 Received: from lily.newcastle.edu.au ([134.148.96.116]) by hawkwind.utcs.utoronto.ca with SMTP id <24662>; Tue, 12 Aug 1997 05:06:25 -0400 Received: (from c9415019@localhost) by lily.newcastle.edu.au (8.8.7/8.6.9) id SAA07860 for rc@hawkwind.utcs.toronto.edu; Tue, 12 Aug 1997 18:19:38 +1000 (EST) From: Russell Davies Message-Id: <199708120819.SAA07860@lily.newcastle.edu.au> Subject: rc,linux,signal,readline To: rc@hawkwind.utcs.toronto.edu Date: Tue, 12 Aug 1997 04:19:37 -0400 X-Mailer: ELM [version 2.4 PL25] Content-Type: text Hi, I have been trying for a while now to get the following working under linux..without success.. a _dynamically linked_ rc shell with; * readline (vi-key) command line editing. * sigints/sigquits working properly (atm they simply do nothing until the next keypress, I want a newline with ';' after a sigint (yes I tried setting fn signint { echo }) as you would expect from most shells) I like some of the features of rc and would like swap shells completely but if I have to complile statically just for these simple features, then the difference in size isnt enough to motivate me to quit using bash. If anyone has compiled an rc shell with the properties mentioned above, I would love to hear from you.. thanks, r. From rc-owner Tue Aug 12 17:02:19 1997 Received: from mail.clark.net ([168.143.0.10]) by hawkwind.utcs.utoronto.ca with SMTP id <24665>; Tue, 12 Aug 1997 16:38:26 -0400 Received: from clark.net (root@explorer.clark.net [168.143.0.7]) by mail.clark.net (8.8.5/8.6.5) with ESMTP id JAA19550; Tue, 12 Aug 1997 09:59:31 -0400 (EDT) Received: from clark.net (culliton@localhost [127.0.0.1]) by clark.net (8.8.5/8.7.1) with ESMTP id JAA05316; Tue, 12 Aug 1997 09:59:30 -0400 (EDT) Message-Id: <199708121359.JAA05316@clark.net> To: Russell Davies cc: rc@hawkwind.utcs.toronto.edu Subject: Re: rc,linux,signal,readline In-reply-to: Your message of "Tue, 12 Aug 1997 04:19:37 EDT." <199708120819.SAA07860@lily.newcastle.edu.au> Date: Tue, 12 Aug 1997 09:59:30 -0400 From: Tom Culliton On Tue, 12 Aug 1997 04:19:37 EDT, Russell Davies wrote: > Hi, > I have been trying for a while now to get the following > working under linux..without success.. > > a _dynamically linked_ rc shell with; I have sent patches to the list which take care of all the rest of your requests, but for some reason the shared/dynamic version of GNU readline doesn't work like the static version. At least thats my first guess as to the problem. Without readline it works "properly" and trips clean when linked dynamically. With readline it doesn't. The size of the statically linked image is with readline unde RedHat Linux 4.2 is 308264 bytes, actually slighty bigger than dynamically linked bash at 300668. On the other hand I think it was Chris (cks) (or maybe Paul) who once gave some good reasons why a shell should be statically linked. > * readline (vi-key) command line editing. I haven't tested this but it's in there. > * sigints/sigquits working properly (atm they simply do nothing > until the next keypress, I want a newline with ';' after a > sigint (yes I tried setting fn signint { echo }) as you would > expect from most shells) The problem is that without my patches readline catches and ignores these signals. If you want to use readline and have reasonable signal behaviour you NEED those patches. The other option is to use a different command line editting package, but I don't know of one that works as well as GNU readline. > I like some of the features of rc and would like swap shells > completely but if I have to complile statically just for these > simple features, then the difference in size isnt enough to > motivate me to quit using bash. If size is your primary concern stick to bash, it tracks the Posix shell standard and will let you work in the generally more portable sh/ksh/bash world. If on the other hand you find ksh and it's ilk to be full of ugly hacky kitchen sink Rube Goldbergisms with a syntax that only a mother could love, and more obscure "features" than the biggest Swiss Army knife ever made, switch to rc. Tom Duff started from scratch and produced a clean, predictable, elegant design that includes most of the good ideas from traditional Unix shells and got rid of most of the cruft. > If anyone has compiled an rc shell with the properties mentioned > above, I would love to hear from you.. > > thanks, > r. From rc-owner Tue Aug 12 17:02:25 1997 Received: from cygnus.co.uk ([194.130.39.3]) by hawkwind.utcs.utoronto.ca with SMTP id <24646>; Tue, 12 Aug 1997 16:35:24 -0400 Received: from nan.cygnus.co.uk (tgoodwin@nan.cygnus.co.uk [194.130.39.19]) by cygnus.co.uk with SMTP id KAA16927; Tue, 12 Aug 1997 10:42:30 +0100 To: Russell Davies CC: rc@hawkwind.utcs.toronto.edu In-Reply-To: <199708120819.SAA07860@lily.newcastle.edu.au> Subject: Re: rc,linux,signal,readline Date: Tue, 12 Aug 1997 05:42:24 -0400 From: Tim Goodwin Message-ID: <5gYAAAAw8DN3owwA@nan.cygnus.co.uk> > I have been trying for a while now to get the following > working under linux..without success.. Are you using rc1.5b2 and readline 2.1? Older versions of readline definitely don't get on with rc... You can get the latest rc from here. ftp://ftp.pipex.net/people/tim/rc-1.5b2.tar.gz I believe this combination mostly works (although personally I use editline). There's a known race condition under Linux which I hope to fix very soon. Please let me know if you can't get it working to your satisfaction. > I like some of the features of rc and would like swap shells > completely but if I have to complile statically just for these > simple features, then the difference in size isnt enough to > motivate me to quit using bash. Which "size" are you trying to economize on? Shells should usually be linked statically anyway (see the recent thread on comp.unix.internals)... for the next release, I'm considering adding `-static' to the link if we're using gcc. Tim. From rc-owner Tue Aug 12 18:06:48 1997 Received: from iadd.jivetech.com ([205.134.227.194]) by hawkwind.utcs.utoronto.ca with SMTP id <24658>; Tue, 12 Aug 1997 18:05:38 -0400 Received: (from haahr@localhost) by iadd.jivetech.com (8.8.5/8.8.5) id OAA00885; Tue, 12 Aug 1997 14:24:34 -0700 From: Paul Haahr X-Attribution: haahr Message-Id: <8PZdii2+2@localhost.localdomain.netcom.com> Date: Tue, 12 Aug 1997 17:24:34 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: Tom Culliton Cc: Russell Davies , rc@hawkwind.utcs.toronto.edu Subject: Re: rc,linux,signal,readline In-Reply-To: <199708121359.JAA05316@clark.net> References: <199708120819.SAA07860@lily.newcastle.edu.au> <199708121359.JAA05316@clark.net> X-Mailer: VM 6.30 under Emacs 19.34.1 > > I have been trying for a while now to get the following > > working under linux..without success.. > > > > a _dynamically linked_ rc shell with; > > I have sent patches to the list which take care of all the rest of > your requests, but for some reason the shared/dynamic version of GNU > readline doesn't work like the static version. At least thats my > first guess as to the problem. Without readline it works "properly" > and trips clean when linked dynamically. With readline it doesn't. Could it be that you're getting the wrong readline.so? There were real changes between the 1.x and 2.x versions, as I remember. > The size of the statically linked image is with readline unde RedHat > Linux 4.2 is 308264 bytes, actually slighty bigger than dynamically > linked bash at 300668. On the other hand I think it was Chris (cks) > (or maybe Paul) who once gave some good reasons why a shell should be > statically linked. I probably said something along those lines, back in the days when we worried about the startup time. 10x performance improvement moots the issue for me. You should have *some* shell, typically lying around in /sbin these days, which is not dynamically linked, for those times when everything else is broken. If rc is your root shell, then making it statically linked is probably a good idea. --p From rc-owner Tue Aug 12 18:07:43 1997 Received: from mail.clark.net ([168.143.0.10]) by hawkwind.utcs.utoronto.ca with SMTP id <24664>; Tue, 12 Aug 1997 18:06:25 -0400 Received: from clark.net (root@explorer.clark.net [168.143.0.7]) by mail.clark.net (8.8.5/8.6.5) with ESMTP id RAA11927; Tue, 12 Aug 1997 17:55:48 -0400 (EDT) Received: from clark.net (culliton@localhost [127.0.0.1]) by clark.net (8.8.5/8.7.1) with ESMTP id RAA15689; Tue, 12 Aug 1997 17:55:47 -0400 (EDT) Message-Id: <199708122155.RAA15689@clark.net> To: Paul Haahr cc: Tom Culliton , Russell Davies , rc@hawkwind.utcs.toronto.edu, culliton@clark.net Subject: Re: rc,linux,signal,readline In-reply-to: Your message of "Tue, 12 Aug 1997 14:24:34 PDT." <8PZdii2+2@localhost.localdomain.netcom.com> Date: Tue, 12 Aug 1997 17:55:46 -0400 From: Tom Culliton On Tue, 12 Aug 1997 14:24:34 PDT, Paul Haahr wrote: > > > I have been trying for a while now to get the following > > > working under linux..without success.. > > > > > > a _dynamically linked_ rc shell with; > > > > I have sent patches to the list which take care of all the rest of > > your requests, but for some reason the shared/dynamic version of GNU > > readline doesn't work like the static version. At least thats my > > first guess as to the problem. Without readline it works "properly" > > and trips clean when linked dynamically. With readline it doesn't. > > Could it be that you're getting the wrong readline.so? There were real > changes between the 1.x and 2.x versions, as I remember. Not as far as I could tell. There are no rcs ident strings in the libraries (Hey, Chet!) but the libs are: -rw-r--r-- 1 root root 154214 Aug 19 1996 /usr/lib/libreadline.a -rw-r--r-- 1 root root 132113 Aug 19 1996 /usr/lib/libreadline.so.2.0 and look pretty much the same via nm. I spent quite a bit of time on this but not being an expert on dynamic linking didn't dig too deep. BTW - does anyone know why on DEC Alpha OSF1, using the libreadline from the freeware CD, it dumps core when I hit ^R? The trace back looks like this: (gdb) core core Core was generated by `rc'. Program terminated with signal 11, Segmentation fault. Reading symbols from /usr/shlib/libc.so...done. #0 0x3ff800d1870 in strlen () (gdb) where #0 0x3ff800d1870 in strlen () #1 0x3ff800d94f0 in _doprnt () #2 0x3ff800d5538 in sprintf () #3 0x120034da4 in rl_message (format=0x14000a830 "%s", arg1=1073818992, arg2=0) at display.c:669 #4 0x120035a20 in rl_display_search (search_string=0x140015d00 "", reverse_p=1, where=-1) at isearch.c:106 #5 0x120035c8c in rl_search_history (direction=-1, invoking_key=18) at isearch.c:193 #6 0x1200358a0 in rl_reverse_search_history (sign=1, key=18) at isearch.c:61 #7 0x120020970 in rl_dispatch (key=18, map=0x140000fb0) at readline.c:636 #8 0x12002007c in readline_internal () at readline.c:345 #9 0x12001fe80 in readline (prompt=0x140012c80 "[culliton@cns5]rc-1.5tjc/ : ") at readline.c:268 #10 0x120016f18 in ugchar () #11 0x120016fe4 in ugchar () warning: Hit heuristic-fence-post without finding warning: enclosing function for address 0xa79d9180f43ffffd This warning occurs if you are debugging a function without any symbols (for example, in a stripped executable). In that case, you may wish to increase the size of the search with the `set heuristic-fence-post' command. Otherwise, you told GDB there was a function where there isn't one, or (more likely) you have encountered a bug in GDB. Pretty cool, huh? ;-) From rc-owner Wed Aug 13 13:05:03 1997 Received: from cygnus.co.uk ([194.130.39.3]) by hawkwind.utcs.utoronto.ca with SMTP id <24669>; Wed, 13 Aug 1997 13:03:39 -0400 Received: from nan.cygnus.co.uk (tgoodwin@nan.cygnus.co.uk [194.130.39.19]) by cygnus.co.uk with SMTP id OAA09148; Wed, 13 Aug 1997 14:33:54 +0100 In-Reply-To: <199708122155.RAA15689@clark.net> Cc: rc@hawkwind.utcs.toronto.edu Subject: Re: rc,linux,signal,readline To: Tom Culliton Date: Wed, 13 Aug 1997 09:33:53 -0400 From: Tim Goodwin Message-ID: > > > Without readline it works "properly" > > > and trips clean when linked dynamically. With readline it doesn't. > Not as far as I could tell. There are no rcs ident strings in the > libraries (Hey, Chet!) but the libs are: > > -rw-r--r-- 1 root root 154214 Aug 19 1996 /usr/lib/libreadline.a > -rw-r--r-- 1 root root 132113 Aug 19 1996 /usr/lib/libreadline.so.2.0 Identical to the RedHat 4.2 (Linux 2.0.30) box on my desk :-). Sorry, I got lost here. What exactly is the problem? I just built rc-1.5b2 (now available from the usual FTP site, thanks Chris!) dynamically linked with readline... ; ldd rc libtermcap.so.2 => /lib/libtermcap.so.2.0.8 libreadline.so.2 => /usr/lib/libreadline.so.2.0 libc.so.5 => /lib/libc.so.5.3.12 ...and it all seems to work ok. Specifically, INTs and QUITs work as I expect. Can you let me know what to look for so I can fix it? > BTW - does anyone know why on DEC Alpha OSF1, using the libreadline > from the freeware CD, it dumps core when I hit ^R? Erp. Sorry, I don't have any Alphas handy. I suspect a readline bug, but if anyone can pin this down to rc I'll try to fix it... Tim. From rc-owner Wed Aug 13 13:07:34 1997 Received: from mail.clark.net ([168.143.0.10]) by hawkwind.utcs.utoronto.ca with SMTP id <24670>; Wed, 13 Aug 1997 13:05:00 -0400 Received: from clark.net (root@explorer.clark.net [168.143.0.7]) by mail.clark.net (8.8.5/8.6.5) with ESMTP id KAA01452; Wed, 13 Aug 1997 10:20:36 -0400 (EDT) Received: from clark.net (culliton@localhost [127.0.0.1]) by clark.net (8.8.5/8.7.1) with ESMTP id KAA02857; Wed, 13 Aug 1997 10:20:35 -0400 (EDT) Message-Id: <199708131420.KAA02857@clark.net> To: Tim Goodwin cc: Tom Culliton , rc@hawkwind.utcs.toronto.edu Subject: Re: rc,linux,signal,readline In-reply-to: Your message of "Wed, 13 Aug 1997 14:33:53 BST." Date: Wed, 13 Aug 1997 10:20:34 -0400 From: Tom Culliton On Wed, 13 Aug 1997 14:33:53 BST, Tim Goodwin wrote: > Sorry, I got lost here. What exactly is the problem? I just built > rc-1.5b2 (now available from the usual FTP site, thanks Chris!) > dynamically linked with readline... Hmmm... I couldn't get the rc-1.5b2 distribution to do that under the same version of Linux you say you're using. It claims it can't find -lreadline. (It's there in /usr/lib/readline.* dammit!) Hacking it into config.h and Makefile by hand seems to work. > ; ldd rc > libtermcap.so.2 => /lib/libtermcap.so.2.0.8 > libreadline.so.2 => /usr/lib/libreadline.so.2.0 > libc.so.5 => /lib/libc.so.5.3.12 > > ...and it all seems to work ok. Specifically, INTs and QUITs work as I > expect. Can you let me know what to look for so I can fix it? Well lets see, for starters it hangs doing a "make trip" which is the basic symptom I remember for the shared libraries. My recollection was that this was usually associated with waiting for a prompt from a subshell, or something like that. Hmmm, this actually looks a bit different, maybe something else is interfering... I'll get back to you on this... Tom From rc-owner Wed Aug 13 17:34:23 1997 Received: from mail.clark.net ([168.143.0.10]) by hawkwind.utcs.utoronto.ca with SMTP id <24650>; Wed, 13 Aug 1997 17:32:26 -0400 Received: from clark.net (root@explorer.clark.net [168.143.0.7]) by mail.clark.net (8.8.5/8.6.5) with ESMTP id NAA08324; Wed, 13 Aug 1997 13:57:43 -0400 (EDT) Received: from clark.net (culliton@localhost [127.0.0.1]) by clark.net (8.8.5/8.7.1) with ESMTP id NAA29765; Wed, 13 Aug 1997 13:57:41 -0400 (EDT) Message-Id: <199708131757.NAA29765@clark.net> To: Tim Goodwin cc: Tom Culliton , rc@hawkwind.utcs.toronto.edu Subject: Re: rc,linux,signal,readline In-reply-to: Your message of "Wed, 13 Aug 1997 14:33:53 BST." Date: Wed, 13 Aug 1997 13:57:41 -0400 From: Tom Culliton On Wed, 13 Aug 1997 14:33:53 BST, Tim Goodwin wrote: > ...and it all seems to work ok. Specifically, INTs and QUITs work as I > expect. Can you let me know what to look for so I can fix it? OK, testing with 1.5b2 out of the box configured --with-readline, "make trip" hangs in trip.rc somewhere after line 411. This is RedHat 4.2, and according to ldd, with the same dynamic libraries as you were using. The following sequence shows a problem with catching signals using readline. [root@cnslab3 rc-1.5b2]# ./rc ; kill -1 $pid Hangup Looks, OK.... [root@cnslab3 rc-1.5b2]# [root@cnslab3 rc-1.5b2]# [root@cnslab3 rc-1.5b2]# ./rc ; fn sighup {echo "Got sighup"} ; kill -1 $pid [root@cnslab3 rc-1.5b2]# ./rc ; fn sighup {echo "Got sighup"} ; kill -1 $pid Hangs and has to be "kill -9"ed I went through this at great length a few months back and came up with a set of patches that do the required clean up after readline. The archives should contain the very detailed messages that I sent to the mailing list describing my discoveries and diagnoses. In summary, readline catches certain signals and resets the terminal state, however there are many more that it doesn't catch, and one (SIGWINCH) that it handles in a rather odd way. When you handle one of these signals within rc instead of exiting, things are left in a bad state. It's probably to be expected that the place where trip.rc hangs is while waiting for a subshell to return, i.e. - catching SIGCHLD. I will try to adapt the patches to 1.5b2 and forward them to you. From rc-owner Sun Aug 17 23:57:59 1997 Received: from tweety.bhp.com.au ([192.83.224.130]) by hawkwind.utcs.utoronto.ca with SMTP id <24660>; Sun, 17 Aug 1997 23:42:12 -0400 Received: from gossamer.itmel.bhp.com.au (gossamer.itmel.bhp.com.au [134.18.115.254]) by tweety.bhp.com.au (8.8.4/8.8.4) with ESMTP id MAA05470 for ; Mon, 18 Aug 1997 12:31:24 +1000 (EST) Received: from nc.itntl.bhp.com.au (nc.itntl.bhp.com.au [134.18.16.178]) by gossamer.itmel.bhp.com.au (8.8.6/8.8.6) with ESMTP id MAA25562 for ; Mon, 18 Aug 1997 12:30:53 +1000 (EST) Received: from nc.itntl.bhp.com.au (localhost [127.0.0.1]) by nc.itntl.bhp.com.au (8.8.6/8.8.6) with ESMTP id MAA13366; Mon, 18 Aug 1997 12:30:48 +1000 (EST) Message-Id: <199708180230.MAA13366@nc.itntl.bhp.com.au> To: rc@hawkwind.utcs.toronto.edu Subject: whatis bug cc: j@nc.itntl.bhp.com.au Date: Sun, 17 Aug 1997 22:30:48 -0400 From: Jason Tyler Instead of printing "$1 not found", whatis says "$1: Permission denied" if $path($#path)^/$1 exists but is not executable. The obvious fix is: *** builtins.c.old Tue Jul 8 01:43:52 1997 --- builtins.c Mon Aug 18 12:05:36 1997 *************** *** 342,348 **** } if (!f) { found = FALSE; ! if (errno != ENOENT) uerror(av[i]); else fprint(2, "%s not found\n", av[i]); --- 342,348 ---- } if (!f) { found = FALSE; ! if (errno != ENOENT && errno != EACCES) uerror(av[i]); else fprint(2, "%s not found\n", av[i]); However, I don't know the source well enough to predict what unwanted side-effects this might cause; can anyone suggest a better solution? jason -- OBrc: fn test-r { >[2=] <$1 } # fails on named pipes From rc-owner Mon Sep 15 17:18:03 1997 Received: from cygnus.co.uk ([194.130.39.3]) by hawkwind.utcs.utoronto.ca with SMTP id <24681>; Mon, 15 Sep 1997 17:01:47 -0400 Received: from nan.cygnus.co.uk (tgoodwin@nan.cygnus.co.uk [194.130.39.19]) by cygnus.co.uk with SMTP id NAA24698 for ; Mon, 15 Sep 1997 13:37:18 +0100 (BST) To: rc@hawkwind.utcs.toronto.edu Subject: Patch for rc-1.5b2 Date: Mon, 15 Sep 1997 08:37:17 -0400 From: Tim Goodwin Message-ID: Here's a one line patch for rc-1.5b2 which fixes a thinko in the autoconf support. If you've had problems with rc dumping core, or refusing to execute files which your group permissions allow you to, this patch should fix them. These problems have been experienced under SunOS 4. This patch will be incorporated into the next official beta release of rc, rc-1.5b3, which I hope to make as soon as I've fixed a race condition in the wait() code. (Experienced under Linux 2.0.30 on a dual processor machine; I suspect it wouldn't occur on a single processor.) Please continue to let me know of any problems or successes you've had with rc-1.5b2. Thanks, Tim. --- which.c 1997/07/01 20:02:57 1.2 +++ which.c 1997/09/15 10:27:18 @@ -88,7 +88,7 @@ gid = getegid(); #if HAVE_GETGROUPS ngroups = getgroups(0, (gid_t *)0); - gidset = malloc(ngroups * sizeof(gid_t)); + gidset = malloc(ngroups * sizeof(GETGROUPS_T)); if (!gidset) uerror("malloc"); else From rc-owner Wed Sep 17 17:27:59 1997 Received: from pandora.earthlight.co.nz ([203.97.8.121]) by hawkwind.utcs.utoronto.ca with SMTP id <24684>; Wed, 17 Sep 1997 17:11:21 -0400 Received: from joe by pandora.earthlight.co.nz with local (Exim 1.62 #1) id 0xBMSc-0004bB-00 (Debian); Thu, 18 Sep 1997 03:55:54 +1200 Message-ID: <19970918035545.53950@pandora> Date: Wed, 17 Sep 1997 11:56:45 -0400 From: Joseph Skinner To: rc@hawkwind.utcs.toronto.edu Subject: are there any patches which add ~ expansion to rc Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.81 Hi the title just about says it all. This is one of the few things that I miss from bash and have noted that this has been added to es. What is the general view of this being part of rc. Also where can I get the latest version of rc and it still being actively developed. Joe. -- ======================================================================= in real life: Joseph Skinner |There's no such thing as a wizard email: joe@earthlight.co.nz |who minds his own business jskinner@es.co.nz | - Berengis the Black http: www.earthlight.co.nz/users/joe| Court Mage to the Earls Caeline ======================================================================== From rc-owner Wed Sep 17 21:48:32 1997 Received: from finch.cse.psu.edu ([130.203.12.29]) by hawkwind.utcs.utoronto.ca with SMTP id <24646>; Wed, 17 Sep 1997 21:47:39 -0400 Received: (qmail 4286 invoked by uid 991); 17 Sep 1997 21:56:37 -0000 Message-ID: <19970917215637.4284.qmail@finch.cse.psu.edu> To: Joseph Skinner cc: rc@hawkwind.utcs.toronto.edu Subject: Re: are there any patches which add ~ expansion to rc In-reply-to: Your message of "Wed, 17 Sep 1997 11:56:45 EDT." <19970918035545.53950@pandora> Date: Wed, 17 Sep 1997 17:56:37 -0400 From: Scott Schwartz Joseph Skinner writes: | What is the general view of this being part of rc. Wrong level of abstraction. Your os should provide a (virtual) filesystem mounted on "/u" so you can say /u/username in every context. Sun's automounter can almost do this right; amd can probably do better. From rc-owner Wed Sep 17 21:49:28 1997 Received: from pertsserver.cs.uiuc.edu ([128.174.247.69]) by hawkwind.utcs.utoronto.ca with SMTP id <24653>; Wed, 17 Sep 1997 21:48:28 -0400 Received: (from mkgardne@localhost) by pertsserver.cs.uiuc.edu (8.8.5/8.8.5) id RAA05196; Wed, 17 Sep 1997 17:08:54 -0500 (CDT) Date: Wed, 17 Sep 1997 18:08:54 -0400 Message-Id: <199709172208.RAA05196@pertsserver.cs.uiuc.edu> From: "Mark K. Gardner" To: joe@earthlight.co.nz CC: rc@hawkwind.utcs.toronto.edu In-reply-to: <19970918035545.53950@pandora> (message from Joseph Skinner on Wed, 17 Sep 1997 11:56:45 -0400) Subject: Re: are there any patches which add ~ expansion to rc Reply-to: mkgardne@cs.uiuc.edu Joe, A while ago I hacked rc to add ~ expansion. (It was a real kludge.) However, after thinking about it more I decided that expansion really belongs in readline/editline. So I modified readline v2.1 to support it. I then had to make a relatively minor change to rc to initialize readline properly and to perform expansion. [Caveat: I decided not to use ~ because of its obvious conflict with pattern matching in rc. Instead I used % which seems to be free. It would have been better if the final expansion was done in readline, but it appeared that readline would be too easy to break.] The modification works fine. I have to remember to use ~ instead of % in emacs though! The patch is too long to post and is of (perhaps) limited interest so I will email it to you directly. Mark -- Mark K. Gardner (mkgardne@cs.uiuc.edu) University of Illinois at Urbana-Champaign Real-Time Systems Laboratory -- From rc-owner Thu Sep 18 01:43:27 1997 Received: from skeeve.atl.ga.us ([208.133.33.161]) by hawkwind.utcs.utoronto.ca with SMTP id <24650>; Thu, 18 Sep 1997 01:40:50 -0400 Received: by skeeve.atl.ga.us (/\==/\ Smail3.1.22.1 #22.1) id ; Wed, 17 Sep 97 22:27 EDT Message-Id: Date: Wed, 17 Sep 1997 22:27:00 -0400 Cc: joe@earthlight.co.nz Subject: Re: are there any patches which add ~ expansion to rc To: rc@hawkwind.utcs.toronto.edu From: arnold@gnu.ai.mit.edu X-Mailer: [XMailTool v3.1.2] > the title just about says it all. I think I did it years ago, it's pretty easy. If you use GNU readline with rc, I (long ago) added ESC-& (I think) to do ~ expansion (in vi mode). Try that and see if it still works. (I use 9term and es). --- Arnold Robbins Internet: arnold@gnu.ai.mit.edu From rc-owner Thu Sep 18 17:10:18 1997 Received: from cygnus.co.uk ([194.130.39.3]) by hawkwind.utcs.utoronto.ca with SMTP id <24664>; Thu, 18 Sep 1997 17:05:43 -0400 Received: from nan.cygnus.co.uk (tgoodwin@nan.cygnus.co.uk [194.130.39.19]) by cygnus.co.uk with SMTP id LAA04470; Thu, 18 Sep 1997 11:14:44 +0100 (BST) In-Reply-To: <19970918035545.53950@pandora> To: Joseph Skinner CC: rc@hawkwind.utcs.toronto.edu Subject: Re: are there any patches which add ~ expansion to rc Date: Thu, 18 Sep 1997 06:14:43 -0400 From: Tim Goodwin Message-ID: <8ncAABP/IDSuhgUA@nan.cygnus.co.uk> > What is the general view of this being part of rc. I agree with Scott that this should be in the filesystem. If not, you have to add it to every last application that uses filenames. (Here, `/home/foo' works everywhere for all foo, although I'm not entirely happy about the symlink farm that makes it happen...) > Also where can I get the latest version of rc and it still being > actively developed. The latest full release is still 1.4, but you might like to try the latest beta release 1.5b2. You can get it from these places. ftp://ftp.sys.utoronto.ca/pub/rc/rc-1.5b2.tar.gz ftp://ftp.pipex.net/people/tim/rc-1.5b2.tar.gz Let me know if you don't have the one-line patch I posted to the list the other day. Tim. From rc-owner Thu Sep 18 20:24:43 1997 Received: from localhost by hawkwind.utcs.utoronto.ca with SMTP id <24666>; Thu, 18 Sep 1997 20:21:44 -0400 To: rc Subject: Re: are there any patches which add ~ expansion to rc In-reply-to: tgoodwin's message of Thu, 18 Sep 1997 06:14:43 -0400. <8ncAABP/IDSuhgUA@nan.cygnus.co.uk> Date: Thu, 18 Sep 1997 19:26:21 -0400 From: Chris Siebenmann Message-Id: <97Sep18.202144edt.24666@hawkwind.utcs.utoronto.ca> Our local solution is a /u directory (automatically) populated with symlinks that point to the appropriate places. We've been running it for years without problems; I can mail people copies of either a sh or a perl version[*] of the script that maintains /u if desired. I've repeatedly found it very handy to have a short name for home directories that works in every program and situation. And better yet there's no need to clog up umpteen programs with code to do ~ expansion. - cks [*: yes, I know I was giving in to the evil empire, but I decided I needed a decently fast program for the system with circa 10,000 passwd entries.] From rc-owner Fri Sep 19 02:58:36 1997 Received: from staff.cs.su.OZ.AU ([129.78.8.1]) by hawkwind.utcs.utoronto.ca with SMTP id <24663>; Fri, 19 Sep 1997 02:49:06 -0400 Received: from suede.sw.oz.au by swallow.sw.oz.au with ESMTP id CAA26147; Fri, 19 Sep 1997 02:21:15 GMT (8.6.10/Unixware) (from jeremy@suede.sw.oz.au for ) Received: by suede.sw.oz.au id CAA19972; Fri, 19 Sep 1997 02:21:14 GMT (SMI-8.6/1.34) (from jeremy for ) From: "Jeremy Fitzhardinge" Message-Id: <9709191221.ZM19970@suede.sw.oz.au> Date: Fri, 19 Sep 1997 13:21:13 -0400 In-Reply-To: Chris Siebenmann "Re: are there any patches which add ~ expansion to rc" (Sep 18, 7:26pm) References: <97Sep18.202144edt.24666@hawkwind.utcs.utoronto.ca> X-Face: '6U=%Tv\k1l-:?\$C[D@G 7(vl~w8&y}!f\bh#wL#n,TGKh>T.c7eT5-y)Hl'i;A1z$9?*lD.k}yqshddFb l[EC}c=;uc%x'}uh3E91p&oE Subject: Re: are there any patches which add ~ expansion to rc Cc: rc@hawkwind.utcs.toronto.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Sep 18, 7:26pm, Chris Siebenmann wrote: > Our local solution is a /u directory (automatically) populated with > symlinks that point to the appropriate places. We've been running it > for years without problems; I can mail people copies of either a sh > or a perl version[*] of the script that maintains /u if desired. While I agree that /u is an elegant approach to dealing with the ~user problem, the most common use of ~ is when referring to one's own home directory, which /u doesn't help with. I once implemented /u as a user-space filesystem under Linux which generated its contents on demand from /etc/passwd. It also had a /u/me which always referred to the caller's home direcory, which is hard to do with a conventional symlink /u. The $H solution is OK for rc, but it has the same problems as ~, in that not everything will understand it. J From rc-owner Fri Sep 19 17:58:31 1997 Received: from cegelecproj.co.uk ([159.245.72.6]) by hawkwind.utcs.utoronto.ca with SMTP id <24656>; Fri, 19 Sep 1997 17:53:55 -0400 Received: from vampire.cegelecproj.co.uk (cerberus.cegelecproj.co.uk) by cegelecproj.co.uk (4.1/SMI-4.1) id AA04877; Fri, 19 Sep 97 08:51:42 BST Received: by vampire.cegelecproj.co.uk (SMI-8.6/SMI-SVR4) id IAA09932; Fri, 19 Sep 1997 08:51:22 +0100 Date: Fri, 19 Sep 1997 03:51:22 -0400 From: Steve_Kilbane@cegelecproj.co.uk Message-Id: <199709190751.IAA09932@vampire.cegelecproj.co.uk> X-Planation: X-Faces images can be viewed with the XFaces program To: jeremy@softway.com.au Subject: Re: are there any patches which add ~ expansion to rc Cc: rc@hawkwind.utcs.toronto.edu X-Face: Iqsa(US9p?)Y^W+6Ff[Z]rM"uFE) lFDjag1e]\/#2 > While I agree that /u is an elegant approach to dealing with the ~user > problem, the most common use of ~ is when referring to one's own > home directory, which /u doesn't help with. True, but then, the problem lies in the ~ semantics, which aren't great. Just as /u/foo can point to user foo's directory, /me (or /m) can point to the current user's. Naturally, this needs special handling in UNIX (as in /proc, /fd), and can be put in $home/lib/profile in Plan 9. What's really annoying is that this is one of the few things that DOS can handle, and plain ol' UNIX can't. From rc-owner Tue Sep 30 15:36:40 1997 Received: from tweety.bhp.com.au ([192.83.224.130]) by hawkwind.utcs.utoronto.ca with SMTP id <24646>; Tue, 30 Sep 1997 15:33:21 -0400 Received: from gossamer.itmel.bhp.com.au (gossamer.itmel.bhp.com.au [134.18.115.254]) by tweety.bhp.com.au (8.8.4/8.8.4) with ESMTP id PAA20415 for ; Tue, 30 Sep 1997 15:22:28 +1000 (EST) Received: from nc.itntl.bhp.com.au (nc.itntl.bhp.com.au [134.18.16.178]) by gossamer.itmel.bhp.com.au (8.8.6/8.8.6) with ESMTP id PAA23315 for ; Tue, 30 Sep 1997 15:21:56 +1000 (EST) Received: from nc.itntl.bhp.com.au (localhost [127.0.0.1]) by nc.itntl.bhp.com.au (8.8.6/8.8.6) with ESMTP id PAA23897; Tue, 30 Sep 1997 15:21:44 +1000 (EST) Message-Id: <199709300521.PAA23897@nc.itntl.bhp.com.au> To: rc@hawkwind.utcs.toronto.edu Subject: rc-1.5b2 and SIGQUIT cc: j@nc.itntl.bhp.com.au Date: Tue, 30 Sep 1997 01:21:43 -0400 From: Jason Tyler On many platforms (at least Solaris, Linux, and OSF3.2), rc-1.5b2 dies if it receives a SIGQUIT whilst inside rc_read(). Adding the following code (which was removed sometime between 1.4 and 1.5b2) back into fdgchar() fixes this: *** input.c.old Tue Sep 30 14:27:28 1997 --- input.c Tue Sep 30 15:07:15 1997 *************** *** 140,145 **** --- 140,147 ---- long /*ssize_t*/ r = rc_read(istack->fd, inbuf + 2, BUFSIZE); sigchk(); if (r < 0) { + if (errno == EINTR) + continue; uerror("read"); rc_exit(1); } However, this may be bad; was the EINTR check taken out for a good reason? If so, how else can I fix the problem? j From rc-owner Tue Sep 30 19:03:49 1997 Received: from finch.cse.psu.edu ([130.203.12.29]) by hawkwind.utcs.utoronto.ca with SMTP id <24674>; Tue, 30 Sep 1997 19:02:37 -0400 Received: (qmail 8907 invoked by uid 991); 30 Sep 1997 19:44:01 -0000 Message-ID: <19970930194401.8905.qmail@finch.cse.psu.edu> To: Jason Tyler cc: rc@hawkwind.utcs.toronto.edu, j@nc.itntl.bhp.com.au Subject: Re: rc-1.5b2 and SIGQUIT In-reply-to: Your message of "Tue, 30 Sep 1997 01:21:43 EDT." <199709300521.PAA23897@nc.itntl.bhp.com.au> Date: Tue, 30 Sep 1997 15:44:01 -0400 From: Scott Schwartz Jason Tyler writes: | However, this may be bad; was the EINTR check taken out for a good | reason? No, it was a bug accidently introduced between rc1.4 and rc1.5. From rc-owner Wed Oct 15 17:04:12 1997 Received: from localhost by hawkwind.utcs.utoronto.ca with SMTP id <24688>; Wed, 15 Oct 1997 17:00:46 -0400 Return-Path: trillian.softwell.se!bengt Received: from mn1.swip.net ([192.71.180.97]) by hawkwind.utcs.utoronto.ca with SMTP id <24660>; Tue, 14 Oct 1997 14:13:28 -0400 Received: by mn1.swip.net (8.8.6/2.01) id NAA05784; Tue, 14 Oct 1997 13:17:38 +0200 (MET DST) Received: (from bengt@localhost) by trillian.softwell.se (8.8.3/8.8.3) id JAA15185 for rc-owner@hawkwind.utcs.toronto.edu; Tue, 14 Oct 1997 09:58:27 +0200 Date: Tue, 14 Oct 1997 03:58:27 -0400 From: Bengt Kleberg Message-Id: <199710140758.JAA15185@trillian.softwell.se> To: rc-owner Subject: config.h-dist for Linux? Resent-To: rc Resent-Date: Wed, 15 Oct 1997 16:56:40 -0400 Resent-From: Chris Siebenmann Resent-Message-Id: <97Oct15.170046edt.24688@hawkwind.utcs.utoronto.ca> Greetings, Is there a config.h-dist for Linux (v2.0.29)? Would rc need changes? The newest rc I know of is 1.5betadev. Bengt From rc-owner Thu Oct 16 17:12:20 1997 Received: from pasanda.cygnus.co.uk ([194.130.39.3]) by hawkwind.utcs.utoronto.ca with SMTP id <24670>; Thu, 16 Oct 1997 16:11:54 -0400 Received: (qmail 8711 invoked from network); 16 Oct 1997 11:07:12 -0000 Received: from nan.cygnus.co.uk (tgoodwin@194.130.39.19) by dns.cygnus.co.uk with QMTP; 16 Oct 1997 11:07:12 -0000 To: Bengt Kleberg CC: rc@hawkwind.utcs.toronto.edu In-Reply-To: <199710140758.JAA15185@trillian.softwell.se> Subject: Re: config.h-dist for Linux? Date: Thu, 16 Oct 1997 07:07:00 -0400 From: Tim Goodwin Message-ID: > Is there a config.h-dist for Linux (v2.0.29)? Would rc need > changes? The newest rc I know of is 1.5betadev. The latest beta version is rc-1.5b2, available from here. ftp://ftp.sys.utoronto.ca/pub/rc/rc-1.5b2.tar.gz This version uses GNU autoconf, and should configure and build for Linux (and everything else!) with no changes. Let me know if you have any problems with it. Tim. From rc-owner Thu Oct 16 22:49:32 1997 Received: from mn1.swip.net ([192.71.180.97]) by hawkwind.utcs.utoronto.ca with SMTP id <24662>; Thu, 16 Oct 1997 22:48:04 -0400 Received: by mn1.swip.net (8.8.6/2.01) id UAA26760; Thu, 16 Oct 1997 20:05:23 +0200 (MET DST) Received: (from bengt@localhost) by trillian.softwell.se (8.8.3/8.8.3) id RAA20933; Thu, 16 Oct 1997 17:28:20 +0200 Date: Thu, 16 Oct 1997 11:28:20 -0400 From: Bengt Kleberg Message-Id: <199710161528.RAA20933@trillian.softwell.se> To: bengt@softwell.se, tgoodwin@cygnus.co.uk Subject: Re: config.h-dist for Linux? Cc: rc@hawkwind.utcs.toronto.edu > The latest beta version is rc-1.5b2 I got it, and it works fine. Thanks. (but I still think POSIX with additional libraries would ahve been a better idea :-) Bengt From rc-owner Wed Feb 4 19:02:55 1998 Received: from np.nosc.mil ([128.49.228.66]) by hawkwind.utcs.utoronto.ca with SMTP id <25048>; Wed, 4 Feb 1998 18:54:23 -0500 Received: (qmail 10458 invoked by uid 1168); 4 Feb 1998 21:23:32 -0000 Date: Wed, 4 Feb 1998 16:23:32 -0500 Message-ID: <19980204212332.10457.qmail@np.nosc.mil> To: debian-devel@lists.debian.org, rc@hawkwind.utcs.toronto.edu Subject: "rc" shell maintainer? From: Vincent Broman Reply-to: broman@nosc.mil -----BEGIN PGP SIGNED MESSAGE----- Who is maintaining the rc package for Debian GNU/Linux? The WNPP doc has said for months that rc is orphaned, but shimon@i-connect.net created an rc1.4 release in november, seemingly taking over from Ian Murdock. There is also an unstable rc-1.5b2 owned by debian-qa, I think, but Murdock is listed as maintainer, and Mark Baker has his name on some stuff in it. The upstream package maintener seems to be Tim Goodwin, since last summer, but the mailing list for rc is quiescent. Vincent Broman, code D712 Bayside Space and Naval Warfare Systems Center, San Diego (was NOSC, NRaD) San Diego, CA 92152-6145, USA Phone: +1 619 553 1641 Email: broman at spawar.navy.mil or nosc.mil PGP protected mail preferred. -----BEGIN PGP SIGNATURE----- Version: 2.6.2 iQCVAwUBNNjcJGCU4mTNq7IdAQG5PwP/cymq12qlIJSpMEi5WiEu80PH0Pvcd2Ym em/YSsGL/EeKz8o51hS7kkjhEiSAiAqNvr0EDDAqp7+LMv169/8zgR/D2CirHvqr TU5MuW2V+IK+UvDnk48J+1MM0aMBWEQueKi/pw3zHGdEQe8z9+SB8kGX6Cj/nZ27 vZQOTqsn9vs= =SHFk -----END PGP SIGNATURE----- From rc-owner Wed Feb 4 23:23:45 1998 Received: from loas.clark.net ([168.143.0.13]) by hawkwind.utcs.utoronto.ca with SMTP id <24670>; Wed, 4 Feb 1998 23:10:37 -0500 Received: from shell.clark.net (root@shell [168.143.0.8]) by loas.clark.net (8.8.8/8.8.8) with ESMTP id UAA18801; Wed, 4 Feb 1998 20:17:21 -0500 (EST) Received: from shell.clark.net (culliton@localhost [127.0.0.1]) by shell.clark.net (8.8.8/8.8.8) with ESMTP id UAA09830; Wed, 4 Feb 1998 20:17:06 -0500 (EST) Message-Id: <199802050117.UAA09830@shell.clark.net> To: broman@nosc.mil cc: debian-devel@lists.debian.org, rc@hawkwind.utcs.toronto.edu, culliton@clark.net Subject: Re: "rc" shell maintainer? In-reply-to: Your message of "Wed, 04 Feb 1998 16:23:32 EST." <19980204212332.10457.qmail@np.nosc.mil> Date: Wed, 4 Feb 1998 20:17:05 -0500 From: Tom Culliton On Wed, 04 Feb 1998 16:23:32 EST, Vincent Broman wrote: > Who is maintaining the rc package for Debian GNU/Linux? > > The WNPP doc has said for months that rc is orphaned, but > shimon@i-connect.net created an rc1.4 release in november, > seemingly taking over from Ian Murdock. There is also an > unstable rc-1.5b2 owned by debian-qa, I think, > but Murdock is listed as maintainer, > and Mark Baker has his name on some stuff in it. > > The upstream package maintener seems to be Tim Goodwin, > since last summer, but the mailing list for rc is quiescent. Yes, the mailing list is pretty quiet these days... ;-) The vanilla distribution works fine with Linux as far as I'm aware and Tim Goodwin is the maintainer. Most of the work I've done is to make it work properly with GNU readline, and my current version works well enough that I haven't done any development on it in a long while. (I'll gladly share my current version with anyone who is interested.) I would volunteer to help, but aside from my work commitments, I'm currently involved in a couple of Python related side projects and my plate is very full indeed. Tom From rc-owner Thu Feb 5 17:45:15 1998 Received: from pantransit.smar.reptiles.org ([198.96.117.26]) by hawkwind.utcs.utoronto.ca with SMTP id <24728>; Thu, 5 Feb 1998 16:59:28 -0500 Received: (qmail 22054 invoked by uid 204); 5 Feb 1998 19:59:04 -0000 Date: Thu, 5 Feb 1998 14:59:03 -0500 Message-ID: <19980205195903.22053.qmail@pantransit.smar.reptiles.org> From: smarry@pantransit.smar.reptiles.org To: culliton@clark.net, smarry@pantransit.smar.reptiles.org Subject: Re: "rc" shell maintainer? Cc: broman@nosc.mil, debian-devel@lists.debian.org, rc@hawkwind.utcs.toronto.edu Tom Culliton writes: >On 05 Feb 1998 05:01:30 GMT, smarry@pantransit.smar.reptiles.org wrote: >[...] >> and the PID that wait(2) returned is lost. rc loops forever calling >> wait(2) with no children, waiting for the lost PID to turn up. > >Shouldn't the "interrupt_happened" flag prevent this? Unfortunately, no. Whether it's set to TRUE or FALSE, the setjmp block gets rerun, and the PID returned from wait(2) (or really wait4(2), I guess) is discarded. I should clarify that I'm not the one having the problems with glibc. They are indeed using RedHat, not sure what version. I'm using libc.so.5.3.12, which turns out to be out of date, but it's the same version as on the RedHat distribution of the other system in question. From rc-owner Thu Feb 5 17:47:52 1998 Received: from pasanda.cygnus.co.uk ([194.130.39.3]) by hawkwind.utcs.utoronto.ca with SMTP id <24695>; Thu, 5 Feb 1998 16:57:59 -0500 Received: (qmail 19866 invoked by alias); 5 Feb 1998 11:47:47 -0000 Received: (qmail 19860 invoked from network); 5 Feb 1998 11:47:46 -0000 Received: from nan.cygnus.co.uk (tgoodwin@194.130.39.19) by dns.cygnus.co.uk with SMTP; 5 Feb 1998 11:47:46 -0000 In-Reply-To: <19980204212332.10457.qmail@np.nosc.mil> Subject: Re: "rc" shell maintainer? To: broman@nosc.mil CC: debian-devel@lists.debian.org, rc@hawkwind.utcs.toronto.edu Date: Thu, 5 Feb 1998 06:46:00 -0500 From: Tim Goodwin Message-ID: > Who is maintaining the rc package for Debian GNU/Linux? Can't help here. > There is also an > unstable rc-1.5b2 owned by debian-qa, I think, By "unstable", do you mean that you are aware of specific problems? If so, *please* let me know about them. > The upstream package maintener seems to be Tim Goodwin, > since last summer, but the mailing list for rc is quiescent. Yes, it's been fairly quiet around here. The current status of rc-1.5b2 is this. o There is a significant problem around the wait() code, which can cause rc to hang on (at least) Linux systems if you '^C' an application. There is a fix for this in the development version, but I'm not entirely happy with it yet. o There is a different bug near wait() which I haven't had a chance to track down yet. o There is a major thinko in the autoconf handling of signals, which causes problems on RedHat 5.0 (but hasn't been reported anywhere else). I believe this will be straightforward to fix. o Some minor tweaks and enhancements to configure have been requested. I haven't had much time recently to spend on rc, but as you can see from the above list, there's not much to be done before I release rc-1.5b3, and I *hope* that will be the last beta before a full rc-1.5 release (but maybe not :-). Again, if you've had any problems with rc-1.5b2, whether with the autoconfiscated build process or with the shell itself, please let me know. Thanks, Tim. From rc-owner Thu Feb 5 17:49:37 1998 Received: from loas.clark.net ([168.143.0.10]) by hawkwind.utcs.utoronto.ca with SMTP id <24704>; Thu, 5 Feb 1998 16:59:04 -0500 Received: from shell.clark.net (root@shell [168.143.0.8]) by loas.clark.net (8.8.8/8.8.8) with ESMTP id KAA13081; Thu, 5 Feb 1998 10:25:58 -0500 (EST) Received: from shell.clark.net (culliton@localhost [127.0.0.1]) by shell.clark.net (8.8.8/8.8.8) with ESMTP id KAA02997; Thu, 5 Feb 1998 10:25:43 -0500 (EST) Message-Id: <199802051525.KAA02997@shell.clark.net> To: smarry@pantransit.smar.reptiles.org cc: broman@nosc.mil, culliton@clark.net, debian-devel@lists.debian.org, rc@hawkwind.utcs.toronto.edu, culliton@clark.net Subject: Re: "rc" shell maintainer? In-reply-to: Your message of "05 Feb 1998 05:01:30 GMT." <19980205050130.12464.qmail@pantransit.smar.reptiles.org> Date: Thu, 5 Feb 1998 10:25:42 -0500 From: Tom Culliton On 05 Feb 1998 05:01:30 GMT, smarry@pantransit.smar.reptiles.org wrote: > Hello, this is Marc Moorcroft. I joined the list shortly after > running into two problems with rc-1.5b2 under Linux. > > One definite bug (reported to Tim Goodwin) will cause rc to spin calling > wait(2) if you do: > > {ls & wait} | cat > > There is another problem with signal handling that is a little more > complicated. When I upgraded to the 2.0.33 kernel, rc began hanging > occasionally when I interrupted programs, and when I finally got irritated > enough to check it thoroughly, I found that it failed trip.rc at: > > kill -2 $pid > > The relevant code is rc_wait() in wait.c: > > static pid_t rc_wait(int *stat) { > int r; > interrupt_happened = FALSE; > if (!setjmp(slowbuf.j)) { > slow = TRUE; > if (!interrupt_happened) > r = wait(stat); > else > r = -1; > } else > r = -1; > slow = FALSE; > return r; > } > > It appears that some of the time, Linux will return from the wait(2) > for the 'kill' process before the signal gets delivered. On Linux > installations where signal(2) has the System V behaviour (system calls > are interrupted for signals that are caught via signal(2)) rc longjmps > out of the signal handler (a rather alarming practice in itself) to the > top of the enclosing code in rc_wait(). The sequence of events appears > to be: > > The signal is sent, > > the process exits, > > wait(2) returns successfully, and > > before the longjmp gadgetry can be turned off (slow = FALSE), > the signal handler IMMEDIATELY runs, > > longjmps back to the top of the setjmp block, > > and the PID that wait(2) returned is lost. rc loops forever calling > wait(2) with no children, waiting for the lost PID to turn up. Shouldn't the "interrupt_happened" flag prevent this? > I've talked to others who have had different problems on other Linux > installations, where caught signals do not interrupt system calls, as > in BSD. This appears to be due to a difference of opinion between the > libc and glibc people about how signals should behave, but I haven't > investigated it myself. It sounds like you're running RedHat 5.0 or some other distribution which uses glibc. I haven't taken that step, partly on the "beware of version X.0 of anything" and partly because I'm waiting until I get a new machine. Sounds like this is another good reason, having heard lots of complaints of problems with glibc. The ultimate solution maybe to move to the world of sigaction/sigblock where those calls are available. The signal handling in rc is one of the hairyest aspects of the code due to portability issues and race conditions. Byron spent a lot of time (the change logs are full of it) fixing race conditions and signal handling before he passed on the torch. (BTW - Anyone heard from him recently?) Tom From rc-owner Thu Feb 5 17:51:03 1998 Received: from pantransit.smar.reptiles.org ([198.96.117.26]) by hawkwind.utcs.utoronto.ca with SMTP id <24656>; Thu, 5 Feb 1998 16:40:00 -0500 Received: (qmail 12465 invoked by uid 204); 5 Feb 1998 05:01:30 -0000 Date: Thu, 5 Feb 1998 00:01:30 -0500 Message-ID: <19980205050130.12464.qmail@pantransit.smar.reptiles.org> From: smarry@pantransit.smar.reptiles.org To: broman@nosc.mil, culliton@clark.net Subject: Re: "rc" shell maintainer? Cc: debian-devel@lists.debian.org, rc@hawkwind.utcs.toronto.edu Hello, this is Marc Moorcroft. I joined the list shortly after running into two problems with rc-1.5b2 under Linux. One definite bug (reported to Tim Goodwin) will cause rc to spin calling wait(2) if you do: {ls & wait} | cat There is another problem with signal handling that is a little more complicated. When I upgraded to the 2.0.33 kernel, rc began hanging occasionally when I interrupted programs, and when I finally got irritated enough to check it thoroughly, I found that it failed trip.rc at: kill -2 $pid The relevant code is rc_wait() in wait.c: static pid_t rc_wait(int *stat) { int r; interrupt_happened = FALSE; if (!setjmp(slowbuf.j)) { slow = TRUE; if (!interrupt_happened) r = wait(stat); else r = -1; } else r = -1; slow = FALSE; return r; } It appears that some of the time, Linux will return from the wait(2) for the 'kill' process before the signal gets delivered. On Linux installations where signal(2) has the System V behaviour (system calls are interrupted for signals that are caught via signal(2)) rc longjmps out of the signal handler (a rather alarming practice in itself) to the top of the enclosing code in rc_wait(). The sequence of events appears to be: The signal is sent, the process exits, wait(2) returns successfully, and before the longjmp gadgetry can be turned off (slow = FALSE), the signal handler IMMEDIATELY runs, longjmps back to the top of the setjmp block, and the PID that wait(2) returned is lost. rc loops forever calling wait(2) with no children, waiting for the lost PID to turn up. I've talked to others who have had different problems on other Linux installations, where caught signals do not interrupt system calls, as in BSD. This appears to be due to a difference of opinion between the libc and glibc people about how signals should behave, but I haven't investigated it myself. From rc-owner Thu Feb 5 19:23:38 1998 Received: from np.nosc.mil ([128.49.228.66]) by hawkwind.utcs.utoronto.ca with SMTP id <23980>; Thu, 5 Feb 1998 19:19:26 -0500 Received: (qmail 17918 invoked by uid 1168); 5 Feb 1998 21:48:31 -0000 Date: Thu, 5 Feb 1998 16:48:31 -0500 Message-ID: <19980205214831.17917.qmail@np.nosc.mil> To: rc@hawkwind.utcs.toronto.edu In-reply-to: (message from Tim Goodwin on Thu, 5 Feb 1998 11:46:00 +0000) Subject: Re: "rc" shell maintainer? From: Vincent Broman Reply-to: broman@nosc.mil -----BEGIN PGP SIGNED MESSAGE----- I tried out rc-1.5b2 on my SunOS 4.1.3 (with most Sun patches) machine and gcc-2.7.2, and I got a core dump during trip. Any suggestions? Program received signal SIGSEGV, Segmentation fault. 0xf773470c in malloc () (gdb) bt #0 0xf773470c in malloc () #1 0xa55c in ealloc (n=12) at nalloc.c:115 #2 0x7398 in get_var_place (s=0xc8f8 "*", stack=TRUE) at hash.c:151 #3 0xc80c in varassign (name=0xc8f8 "*", def=0x1b814, stack=TRUE) at var.c:18 #4 0xcc18 in starassign (dollarzero=0x1b838 "", a=0x1b810, stack=TRUE) at var.c:143 #5 0x239c in funcall (av=0x1b800) at builtins.c:77 #6 0x3d0c in exec (s=0x2374, parent=TRUE) at exec.c:90 #7 0xd494 in walk (n=0x1b788, parent=TRUE) at walk.c:37 #8 0x8694 in doit (execit=TRUE) at input.c:296 #9 0x9fa4 in main (argc=2, argv=0xf7ffef4c, envp=0xf7ffef50) at main.c:98 This appears to bomb in malloc while the argument list is being set up to execute "submatch 'umask bad' 'bad umask' 'bad umask'". I have essentially no trouble on another SunOS 4.1.4 machine with the same source code. This problem occurs with readline, editline, or nothing added. The following are the only local changes I've made. - --- config.h.in.orig Mon Jul 7 08:43:53 1997 +++ config.h.in Wed Feb 4 15:40:59 1998 @@ -2,4 +2,5 @@ #undef STDC_HEADERS +#undef HAVE_SYS_TYPES_H #undef HAVE_SYS_RESOURCE_H #undef RLIMIT_NEEDS_KERNEL - --- configure.in.orig Mon Jul 7 08:43:53 1997 +++ configure.in Wed Feb 4 16:48:10 1998 @@ -277,10 +277,14 @@ AC_ARG_WITH(editline, [ --with-editline Simmule Turner's line editing], AC_CHECK_LIB(edit, readline, - - AC_DEFINE(READLINE) LIBS="$LIBS -ledit", + AC_DEFINE(READLINE) + LIBS="-ledit $LIBS", AC_MSG_WARN(editline library not found))) AC_ARG_WITH(readline, [ --with-readline Bloated GNU line editing], + AC_CHECK_LIB(termcap,tputs,LIBS="-ltermcap $LIBS", + AC_CHECK_LIB(ncurses,tputs,LIBS="-lncurses $LIBS")) AC_CHECK_LIB(readline, readline, - - AC_DEFINE(READLINE) LIBS="$LIBS -lreadline -ltermcap", + AC_DEFINE(READLINE) + LIBS="-lreadline $LIBS", AC_MSG_WARN(readline library not found))) - --- which.c.orig Mon Jul 7 08:43:53 1997 +++ which.c Wed Feb 4 17:02:32 1998 @@ -20,5 +20,5 @@ #define X_ALL (X_USR|X_GRP|X_OTH) - -extern int stat(const char *, struct stat *); +extern int stat(char *, struct stat *); static bool initialized = FALSE; @@ -88,5 +88,5 @@ gid = getegid(); #if HAVE_GETGROUPS - - ngroups = getgroups(0, (gid_t *)0); + ngroups = getgroups(0, (GETGROUPS_T *)0); gidset = malloc(ngroups * sizeof(gid_t)); if (!gidset) Vincent Broman, code D712 Bayside Space and Naval Warfare Systems Center, San Diego (was NOSC, NRaD) San Diego, CA 92152-6145, USA Phone: +1 619 553 1641 Email: broman at spawar.navy.mil or nosc.mil PGP protected mail preferred. -----BEGIN PGP SIGNATURE----- Version: 2.6.2 iQCVAwUBNNozTGCU4mTNq7IdAQGtUwP/W/hnkSZKulAZhodR7+b3fX+M1WnISqLp XHB614mZVY0prcuoPpf0sXwb4nxLu3R03PhXCsymGnxzmyPR9nzqY+zOjniZd8SA ow6h59DBPA3Or5ULOWJfeSC/+K53s7dXwbS1FH9QkclF/hhICd1u6Uzf5A6pa+ND 8l3Anxd9/X8= =28Zb -----END PGP SIGNATURE----- From rc-owner Fri Feb 6 17:40:41 1998 Received: from pasanda.cygnus.co.uk ([194.130.39.3]) by hawkwind.utcs.utoronto.ca with SMTP id <24733>; Fri, 6 Feb 1998 17:13:20 -0500 Received: (qmail 1005 invoked by alias); 6 Feb 1998 17:45:27 -0000 Received: (qmail 995 invoked from network); 6 Feb 1998 17:45:26 -0000 Received: from nan.cygnus.co.uk (tgoodwin@194.130.39.19) by dns.cygnus.co.uk with SMTP; 6 Feb 1998 17:45:26 -0000 In-Reply-To: <19980205050130.12464.qmail@pantransit.smar.reptiles.org> To: smarry@pantransit.smar.reptiles.org Subject: Re: "rc" shell maintainer? Cc: rc@hawkwind.utcs.toronto.edu, broman@nosc.mil, culliton@clark.net Date: Fri, 6 Feb 1998 12:45:04 -0500 From: Tim Goodwin Message-ID: > One definite bug (reported to Tim Goodwin) will cause rc to spin calling > wait(2) if you do: > > {ls & wait} | cat Fixed in the development version. > There is another problem with signal handling that is a little more > complicated. When I upgraded to the 2.0.33 kernel, rc began hanging > occasionally when I interrupted programs, I have a fix for this, but I'm not completely happy with it yet. When I am, and I've fixed a couple of other minor problems, I'll cut a 1.5b3 release for y'all to check out. Thanks for the bug report. Tim. From rc-owner Fri Feb 6 17:40:46 1998 Received: from pasanda.cygnus.co.uk ([194.130.39.3]) by hawkwind.utcs.utoronto.ca with SMTP id <24735>; Fri, 6 Feb 1998 17:17:21 -0500 Received: (qmail 1317 invoked by alias); 6 Feb 1998 18:01:00 -0000 Received: (qmail 1309 invoked from network); 6 Feb 1998 18:00:59 -0000 Received: from nan.cygnus.co.uk (tgoodwin@194.130.39.19) by dns.cygnus.co.uk with SMTP; 6 Feb 1998 18:00:59 -0000 In-Reply-To: <19980205214831.17917.qmail@np.nosc.mil> Subject: Re: "rc" shell maintainer? To: broman@nosc.mil CC: rc@hawkwind.utcs.toronto.edu Date: Fri, 6 Feb 1998 13:00:37 -0500 From: Tim Goodwin Message-ID: Thanks for the bug report. > I tried out rc-1.5b2 on my SunOS 4.1.3 (with most Sun patches) machine > and gcc-2.7.2, and I got a core dump during trip. Any suggestions? This change looks wrong to me. > - - ngroups = getgroups(0, (gid_t *)0); > + ngroups = getgroups(0, (GETGROUPS_T *)0); There was a bug in rc-1.5b2, but the fix for 1.5b3 will be as appended. (Incidentally, I finally tracked this one down using ElectricFence. Thanks to Bruce Perens for a marvellous piece of software.) Tim. --- release/rc-1.5b2/which.c Mon Jul 7 16:43:32 1997 +++ rc-1.5b3/which.c Thu Feb 5 15:23:59 1998 @@ -88,7 +88,7 @@ gid = getegid(); #if HAVE_GETGROUPS ngroups = getgroups(0, (gid_t *)0); - gidset = malloc(ngroups * sizeof(gid_t)); + gidset = malloc(ngroups * sizeof(GETGROUPS_T)); if (!gidset) uerror("malloc"); else From rc-owner Fri Feb 6 23:14:51 1998 Received: from np.nosc.mil ([128.49.228.66]) by hawkwind.utcs.utoronto.ca with SMTP id <24658>; Fri, 6 Feb 1998 23:08:18 -0500 Received: (qmail 3082 invoked by uid 1168); 6 Feb 1998 22:54:55 -0000 Date: Fri, 6 Feb 1998 17:54:55 -0500 Message-ID: <19980206225455.3081.qmail@np.nosc.mil> To: rc@hawkwind.utcs.toronto.edu In-reply-to: (message from Tim Goodwin on Fri, 6 Feb 1998 18:00:37 +0000) Subject: Re: "rc" shell maintainer? From: Vincent Broman Reply-to: broman@nosc.mil -----BEGIN PGP SIGNED MESSAGE----- tgoodwin@cygnus.co.uk replied to me: >> I tried out rc-1.5b2 on my SunOS 4.1.3 (with most Sun patches) machine >> and gcc-2.7.2, and I got a core dump during trip. Any suggestions? > >This change looks wrong to me. > >> - ngroups = getgroups(0, (gid_t *)0); >> + ngroups = getgroups(0, (GETGROUPS_T *)0); The reason for GETGROUPS_T (which POSIX requires to be gid_t) is that some systems, like sunos413, fail to conform to posix by using int's instead of gid_t's for the arrays of groups. This change is for pedantic consistency, NULL being all zeroes for all the hardware I ever deal with. About the core dump... It looks like the binary built on 413 runs fine on 414 but dumps core on a 413 machine. The same thing occurs with a statically linked binary. Also the same with a binary built on 414. So the problem is in my malloc library, I think. It isn't the realloc(NULL,n) bug. Suggestions? Vincent Broman broman@nosc.mil +1 619 553 1641 -----BEGIN PGP SIGNATURE----- Version: 2.6.2 iQCVAwUBNNuUfWCU4mTNq7IdAQHIagQAhgk52/AdER9BClyhMxKLdwtF5HmZv7wn zsgzVs9Wrca+iu9pxSI8x2i7fVZ1I0uGhGQ2tEtUyLvRIIOWxmTg2C2NtcJySwLs nPB0JxpzPOGwc21WBevjvoY36hwiRSYI2gc0Jk6HE51BZlyqJ4pYlPRtQ296/X7L qQVEOBr0cfE= =2CWB -----END PGP SIGNATURE----- From rc-owner Mon Feb 9 18:34:06 1998 Received: from np.nosc.mil ([128.49.228.66]) by hawkwind.utcs.utoronto.ca with SMTP id <24842>; Mon, 9 Feb 1998 18:12:04 -0500 Received: (qmail 4058 invoked by uid 1168); 9 Feb 1998 20:31:35 -0000 Date: Mon, 9 Feb 1998 15:31:35 -0500 Message-ID: <19980209203135.4057.qmail@np.nosc.mil> To: rc@hawkwind.utcs.toronto.edu In-reply-to: (message from Tim Goodwin on Fri, 6 Feb 1998 18:00:37 +0000) Subject: Re: "rc" shell maintainer? From: Vincent Broman Reply-to: broman@nosc.mil -----BEGIN PGP SIGNED MESSAGE----- > Did you try the patch I sent, which changes gid_t to GETGROUPS_T on the > subsequent line, too? Woops, it didn't sink in that that was an additional patch. - From your tip, I ended up with the following which seems to work. - --- which.c.orig Mon Jul 7 08:43:53 1997 +++ which.c Mon Feb 9 12:27:55 1998 @@ -33,5 +33,5 @@ static int ingidset(gid_t g) { - - gid_t i; + int i; for (i = 0; i < ngroups; ++i) if (g == gidset[i]) @@ -88,6 +88,6 @@ gid = getegid(); #if HAVE_GETGROUPS - - ngroups = getgroups(0, (gid_t *)0); - - gidset = malloc(ngroups * sizeof(gid_t)); + ngroups = getgroups(0, (GETGROUPS_T *)0); + gidset = malloc(ngroups * sizeof(GETGROUPS_T)); if (!gidset) uerror("malloc"); Thanks. V Broman -----BEGIN PGP SIGNATURE----- Version: 2.6.2 iQCVAwUBNN9nk2CU4mTNq7IdAQFrBQP9GcJ5EBvhJHtt72H8D1tZ1fU69JjsPWEn 3KwTZYUFxKRIbMnqxiNaokdjK2iDlzxagYqZalEhC9oNs/LVBOn1kLL1i0I06mth sj/aC0wF6/AkdUVP4rWIbv0IF4umlbFW4Ayqyy5AJJo7jH3Z6nw1rgL3ccw+PLPK 33rmO1n8G6c= =F+kV -----END PGP SIGNATURE----- From rc-owner Tue Feb 10 17:54:03 1998 Received: from np.nosc.mil ([128.49.228.66]) by hawkwind.utcs.utoronto.ca with SMTP id <24649>; Tue, 10 Feb 1998 17:22:29 -0500 Received: (qmail 4268 invoked by uid 1168); 9 Feb 1998 23:45:04 -0000 Date: Mon, 9 Feb 1998 18:45:04 -0500 Message-ID: <19980209234504.4267.qmail@np.nosc.mil> To: rc@hawkwind.utcs.toronto.edu In-reply-to: (message from Tim Goodwin on Fri, 6 Feb 1998 18:00:37 +0000) Subject: Re: "rc" shell maintainer? From: Vincent Broman Reply-to: broman@nosc.mil -----BEGIN PGP SIGNED MESSAGE----- My rc-1.5b2 fails to trip because of the line testing prompt=';' if (!~ `` '' {. -i /tmp/dot.$pid>[2=1]} ';hi'^$nl';') It seems that '. -i' used to output prompts, but in 1.5b2 it does not. Was this change unintentional? I'd be uneasy about changing trip.rc to match spec "improvements". Vincent Broman, code D712 Bayside Space and Naval Warfare Systems Center, San Diego (was NOSC, NRaD) San Diego, CA 92152-6145, USA Phone: +1 619 553 1641 Email: broman at spawar.navy.mil or nosc.mil PGP protected mail preferred. -----BEGIN PGP SIGNATURE----- Version: 2.6.2 iQCVAwUBNN+U8mCU4mTNq7IdAQGncAQAlXGd9qklVzMZMdMVx3PuKc1cuURUKsQ3 IlDuoAQAYiSihBOAAP8QLCZ6DZHu+n0CbcLGRK82BfY62pgBbnkEis9Wsqez/R+k 7RP30hA0QCdJYBGesapfabPcAvacFoC4ym5dZoTVTsz04gLMDGjzE8gkRJm4kScZ fto3Io37gy8= =rstH -----END PGP SIGNATURE----- From rc-owner Tue Feb 10 19:30:30 1998 Received: from loas.clark.net ([168.143.0.13]) by hawkwind.utcs.utoronto.ca with SMTP id <24674>; Tue, 10 Feb 1998 19:24:27 -0500 Received: from shell.clark.net (root@shell [168.143.0.8]) by loas.clark.net (8.8.8/8.8.8) with ESMTP id SAA01935; Tue, 10 Feb 1998 18:26:53 -0500 (EST) Received: from shell.clark.net (culliton@localhost [127.0.0.1]) by shell.clark.net (8.8.8/8.8.8) with ESMTP id SAA10989; Tue, 10 Feb 1998 18:26:41 -0500 (EST) Message-Id: <199802102326.SAA10989@shell.clark.net> To: broman@nosc.mil cc: rc@hawkwind.utcs.toronto.edu Subject: Re: "rc" shell maintainer? In-reply-to: Your message of "Mon, 09 Feb 1998 18:45:04 EST." <19980209234504.4267.qmail@np.nosc.mil> Date: Tue, 10 Feb 1998 18:26:40 -0500 From: Tom Culliton On Mon, 09 Feb 1998 18:45:04 EST, Vincent Broman wrote: > My rc-1.5b2 fails to trip because of the line testing > > prompt=';' if (!~ `` '' {. -i /tmp/dot.$pid>[2=1]} ';hi'^$nl';') > > It seems that '. -i' used to output prompts, but in 1.5b2 it does not. > Was this change unintentional? I'd be uneasy about changing > trip.rc to match spec "improvements". Hmmm... This sounds familiar, are you building with GNU Readline? Now all I have to do is remember what I did to fix it... 8-/ I probably posted a patch... Aha... Yes I did, but Tim never picked it up. Look back through the archives for a message from me which moves print_prompt2 from lex.c to input.c amoung other things. I sent it before my big signal handling fix. From rc-owner Wed Feb 11 17:06:01 1998 Received: from pasanda.cygnus.co.uk ([194.130.39.3]) by hawkwind.utcs.utoronto.ca with SMTP id <24726>; Wed, 11 Feb 1998 16:55:45 -0500 Received: (qmail 9308 invoked by alias); 11 Feb 1998 10:46:00 -0000 Received: (qmail 9304 invoked from network); 11 Feb 1998 10:45:58 -0000 Received: from nan.cygnus.co.uk (tgoodwin@194.130.39.19) by dns.cygnus.co.uk with SMTP; 11 Feb 1998 10:45:58 -0000 In-Reply-To: <199802102326.SAA10989@shell.clark.net> To: rc@hawkwind.utcs.toronto.edu Subject: Re: "rc" shell maintainer? Date: Wed, 11 Feb 1998 05:45:36 -0500 From: Tim Goodwin Message-ID: > > My rc-1.5b2 fails to trip because of the line testing > > > > prompt=';' if (!~ `` '' {. -i /tmp/dot.$pid>[2=1]} ';hi'^$nl';') > > > > It seems that '. -i' used to output prompts, but in 1.5b2 it does not. > > Was this change unintentional? I'd be uneasy about changing > > trip.rc to match spec "improvements". This hasn't changed since 1.4: `-i' only works as documented if you don't use readline or editline. I guess this is a bug, although I haven't thought about it much. (The trip failure is documented in the README file, for what it's worth.) > I probably posted a patch... Aha... Yes I did, but Tim never picked > it up. rc-1.5b2 was purely an autoconfiscation of rc-1.5betadev-1; I didn't include any patches that had gone to the list. This was the quickest way for me to get on top of the project. > Look back through the archives for a message from me which > moves print_prompt2 from lex.c to input.c amoung other things. OK, I've got that, and will have a look at it. Thanks, Tim. From rc-owner Wed Feb 11 17:25:24 1998 Received: from np.nosc.mil ([128.49.228.66]) by hawkwind.utcs.utoronto.ca with SMTP id <23980>; Wed, 11 Feb 1998 17:24:46 -0500 Received: (qmail 18611 invoked by uid 1168); 11 Feb 1998 21:55:54 -0000 Date: Wed, 11 Feb 1998 16:55:53 -0500 Message-ID: <19980211215553.18610.qmail@np.nosc.mil> To: rc@hawkwind.utcs.toronto.edu In-reply-to: <199802102326.SAA10989@shell.clark.net> (message from Tom Culliton on Tue, 10 Feb 1998 18:26:40 -0500) Subject: Re: "rc" shell maintainer? From: Vincent Broman Reply-to: broman@nosc.mil -----BEGIN PGP SIGNED MESSAGE----- > This sounds familiar, are you building with GNU Readline? I checked out the prompt issue again. With readline from GNU or vrl, the prompt is missing, with no readline, the prompt is there and trip passes. Another small point.... I notice that with 1.5b2, the trip output includes an additional spurious "trip complete" line. This seems to be caused by the "if (! @{cd /; ~ */a*.$pid tmp/a*})" line. The forked shell handling the @{} inherits the fn sigexit defined in trip.rc and executes it when the @{} finishes. This did not happen in 1.4, probably never before that either. Vincent Broman, code D712 Bayside Space and Naval Warfare Systems Center, San Diego (was NOSC, NRaD) San Diego, CA 92152-6145, USA Phone: +1 619 553 1641 Email: broman at spawar.navy.mil or nosc.mil PGP protected mail preferred. -----BEGIN PGP SIGNATURE----- Version: 2.6.2 iQCVAwUBNOIeVGCU4mTNq7IdAQEiaQQAwJoe2Jh/UjKswKfNXwtmQxj2p8YePmvH gzj3q5vNqOz0/LFJU/fiAZbSB0Oe11m97+DVMFYLwdjE9URhUc/nkI/m8Sdug9/d lB5hHVE9/1vaLh542HDeteRK9FpiVrIAVFYqtoRZVjzYKKBUVtFr1YyrdRvM23KX Q3hAbM3xfXY= =7rEK -----END PGP SIGNATURE----- From rc-owner Wed Feb 11 17:25:39 1998 Received: from loas.clark.net ([168.143.0.10]) by hawkwind.utcs.utoronto.ca with SMTP id <24649>; Wed, 11 Feb 1998 17:25:22 -0500 Received: from shell.clark.net (root@shell [168.143.0.8]) by loas.clark.net (8.8.8/8.8.8) with ESMTP id RAA28888; Wed, 11 Feb 1998 17:23:26 -0500 (EST) Received: from shell.clark.net (culliton@localhost [127.0.0.1]) by shell.clark.net (8.8.8/8.8.8) with ESMTP id RAA20523; Wed, 11 Feb 1998 17:23:13 -0500 (EST) Message-Id: <199802112223.RAA20523@shell.clark.net> To: Tim Goodwin cc: rc@hawkwind.utcs.toronto.edu Subject: Re: "rc" shell maintainer? In-reply-to: Your message of "Wed, 11 Feb 1998 05:45:36 EST." Date: Wed, 11 Feb 1998 17:23:13 -0500 From: Tom Culliton On Wed, 11 Feb 1998 05:45:36 EST, Tim Goodwin wrote: > > > My rc-1.5b2 fails to trip because of the line testing > > > > > > prompt=';' if (!~ `` '' {. -i /tmp/dot.$pid>[2=1]} ';hi'^$nl';') > > > > > > It seems that '. -i' used to output prompts, but in 1.5b2 it does not. > > > Was this change unintentional? I'd be uneasy about changing > > > trip.rc to match spec "improvements". > > This hasn't changed since 1.4: `-i' only works as documented if you > don't use readline or editline. I guess this is a bug, although I > haven't thought about it much. Up until the wait bug cropped up in Linux, rc was tripping cleanly for me under Linux, Solaris, SunOs, AIX, ... with readline. The patch for the prompt problem was pretty obvious when I looked at it. From rc-owner Thu Feb 12 05:43:30 1998 Received: from pasanda.cygnus.co.uk ([194.130.39.3]) by hawkwind.utcs.utoronto.ca with SMTP id <24689>; Thu, 12 Feb 1998 05:31:17 -0500 Received: (qmail 1009 invoked by alias); 12 Feb 1998 10:24:06 -0000 Received: (qmail 1005 invoked from network); 12 Feb 1998 10:24:05 -0000 Received: from nan.cygnus.co.uk (tgoodwin@194.130.39.19) by dns.cygnus.co.uk with SMTP; 12 Feb 1998 10:24:05 -0000 Subject: Re: "rc" shell maintainer? To: rc@hawkwind.utcs.toronto.edu In-Reply-To: <19980211215553.18610.qmail@np.nosc.mil> <199802112223.RAA20523@shell.clark.net> Date: Thu, 12 Feb 1998 05:23:43 -0500 From: Tim Goodwin Message-ID: > Up until the wait bug cropped up in Linux, rc was tripping cleanly for > me under Linux, Solaris, SunOs, AIX, ... with readline. Really? Hmm... > The patch for > the prompt problem was pretty obvious when I looked at it. Yup. Now incorporated into the development version. > I notice that with 1.5b2, the trip output includes an additional > spurious "trip complete" line. Fixed. A number of calls to setsigdefaults() were removed between 1.4 and 1.5betadev1, but the one after the nSubshell fork() is needed. I've reinstated it. This is the current state of play. I'm not aware of any bugs in my development version. I need to review my fix for the wait() race that Linux exercises. There are a couple of packaging issues to tidy up. I hope to get rc-1.5b3 out in the next week. Thanks again for all your input. Tim. From rc-owner Fri Feb 20 23:09:10 1998 Received: from np.nosc.mil ([128.49.228.66]) by hawkwind.utcs.utoronto.ca with SMTP id <24650>; Fri, 20 Feb 1998 22:35:40 -0500 Received: (qmail 6105 invoked by uid 1168); 20 Feb 1998 01:08:42 -0000 Date: Thu, 19 Feb 1998 20:08:42 -0500 Message-ID: <19980220010842.6104.qmail@np.nosc.mil> To: rc@hawkwind.utcs.toronto.edu In-reply-to: (message from Tim Goodwin on Thu, 19 Feb 1998 18:05:48 +0000) Subject: Re: rc-1.5b3 nearly ready for release From: Vincent Broman Reply-to: broman@nosc.mil -----BEGIN PGP SIGNED MESSAGE----- I tried out the nearly-rc-1.5b3 on sparc-sun-sunos413 with gcc and it was OK except for one thing, the prototype for stat() in which.c conflicts with that supplied by Sun, which lacks a "const". I would suppose the prototype would belong in "sys/stat.h". If we do need a declaration in which.c, it could be no more than "extern int stat();". The vanilla source compiles and trips fine on Debian GNU/Linux 1.3.1, with gcc 2.7.2.1, libc 5.4.33, and kernel 2.0.33, except that strangely enough "cat" writes its error message "cat: -: Bad file number" twice in a row. It seems to be cat's problem. It might be nice if make distclean did not remove y.tab.? in the case where byacc is not available. The BUILT_SOURCES macro doesn't seem to include sigmsgs.h or y.tab.h . The whole approach of grepping in signal.h for signal names and meanings is inherently fragile and unnatural. Based on a suggestion from the Debian developers group, I quickly hacked together an auxillary C program now found at http://archimedes.nosc.mil/transfer/mksignals.c which checks by means of #ifdef for all the signal names found on machines I have access to and writes out the sigmsgs.* files directly. This means that mksignal could be replaced by mksignals.c, with Makefile lines like these. mksignals: $(srcdir)/mksignals.c $(CC) $(srcdir)/mksignals.c -o mksignals sigmsgs.c sigmsgs.h: mksignals ./mksignals A "make clean" should also remove the executable, mksignals. The list of signal names could be easily expanded to included any special signals defined on machines other than my own stable of: linux, sunos, solaris, next, hpux, and os/2 emx. Vincent Broman, code D712 Bayside Space and Naval Warfare Systems Center, San Diego (was NOSC, NRaD) San Diego, CA 92152-6145, USA Phone: +1 619 553 1641 Email: broman at spawar.navy.mil or nosc.mil PGP protected mail preferred. -----BEGIN PGP SIGNATURE----- Version: 2.6.2 iQCVAwUBNOzXg2CU4mTNq7IdAQH/mgQAvDPTyjtvWySqmvQhzv8+6Q88obrdrmwq PK3NI3LtL5mBYGWF2hi0vxzb6srPd+rUN6O/I+uTSJzhx7UUCAAIfi9qstSYdfj1 ndR2N9wcodZY+BsTHP04rLQBm+qjwjLSE66Flki7+Hfz1ZtuX7JgQ6T4v6gYGF3a XHMKcp/DVpE= =/80D -----END PGP SIGNATURE----- From rc-owner Mon May 25 18:28:55 1998 Received: from pandora.earthlight.co.nz ([203.97.8.121]) by hawkwind.utcs.utoronto.ca with SMTP id <24884>; Mon, 25 May 1998 17:47:37 -0400 Received: from joe by pandora.earthlight.co.nz with local (Exim 1.92 #1) id 0ydbsI-0004ou-00 (Debian); Mon, 25 May 1998 02:35:26 +1200 Message-ID: <19980525023525.59886@pandora> Date: Sun, 24 May 1998 10:35:25 -0400 From: Joseph Skinner To: rc@hawkwind.utcs.toronto.edu Subject: problems with an rc script called from cron Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.81 Hi I am having problems with the following script ============================================================ #! /usr/bin/rc res=`{telnet phoenix.earthlight.co.nz 4647 >[2] /dev/null} echo `{date} ' ' $res(10) >> /home/joe/bin/modemcheck.log if ( ~ $res 1 2 3 ) {killppp 900 } ============================================================ This script works fine when called from the command line but when run from cron nothing is returned in the variable $res. Anyone have any suggestions as to what is going wrong here. Joe. ps. I am I still on this list as things seem to have been very quite recently. -- ======================================================================= in real life: Joseph Skinner |There's no such thing as a wizard email: joe@earthlight.co.nz |who minds his own business Analyst/Programmer ECL | - Berengis the Black http: www.earthlight.co.nz/users/joe| Court Mage to the Earls Caeline ======================================================================== From rc-owner Sat May 30 17:32:42 1998 Received: from karon.dynas.se ([192.71.43.4]) by hawkwind.utcs.utoronto.ca with SMTP id <24695>; Sat, 30 May 1998 16:32:36 -0400 Received: (qmail 13356 invoked from network); 26 May 1998 06:25:02 -0000 Received: from spirit.sto.dynas.se (HELO spirit.dynas.se) (172.16.1.10) by karon.dynas.se with SMTP; 26 May 1998 06:25:01 -0000 Received: from pommac.dynas.se by spirit.dynas.se with smtp (Smail3.1.28.1 #32) id m0yeDAT-000JeeC; Tue, 26 May 98 08:25:01 +0200 Message-Id: Date: Tue, 26 May 1998 02:25:01 -0400 From: bengt Reply-To: bengt Subject: Re: problems with an rc script called from cron To: joe@earthlight.co.nz Cc: rc@hawkwind.utcs.toronto.edu MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Content-MD5: Aa2qvx4x0ZxiOjYXh1d32A== X-Mailer: dtmail 1.2.0 CDE Version 1.2 SunOS 5.6 i86pc i386 > I am having problems with the following script > > ============================================================ > #! /usr/bin/rc > > res=`{telnet phoenix.earthlight.co.nz 4647 >[2] /dev/null} > echo `{date} ' ' $res(10) >> /home/joe/bin/modemcheck.log > if ( ~ $res 1 2 3 ) {killppp 900 } > ============================================================ > > This script works fine when called from the command line but when run > from cron nothing is returned in the variable $res. > > Anyone have any suggestions as to what is going wrong here. No suggestions yet, but could you answer the following. What happens if you use "echo hello" insted of "telnet ..."? What happens if you do the same thing using "sh"? > ps. I am I still on this list as things seem to have been very quite > recently. Lists are full of 1) Bug reports or 2) Pleas for new features or 3) "How do I do this?" My guess is that: There is not many bugs left in rc. The users of rc thinks there should not be more features (I do. I would actually like to get rid of else and reinstate ifnot). The users of rc are competent enough to handle the things they want to do. Best Wishes, Bengt =============================================================== Everything aforementioned should be regarded as totally private opinions, and nothing else. bengt@softwell.se ``His great strength is that he is uncompromising. It would make him physically ill to think of programming in C++.'' From rc-owner Sat May 30 17:41:44 1998 Received: from iadd.jivetech.com ([206.24.112.242]) by hawkwind.utcs.utoronto.ca with SMTP id <24728>; Sat, 30 May 1998 16:35:28 -0400 Received: (from haahr@localhost) by iadd.jivetech.com (8.8.5/8.8.5) id HAA10959; Tue, 26 May 1998 07:28:18 -0700 From: Paul Haahr X-Attribution: haahr Message-Id: <8RqJ61362@iadd.jivetech.com> Date: Tue, 26 May 1998 10:28:17 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: Joseph Skinner Cc: rc@hawkwind.utcs.toronto.edu Subject: Re: problems with an rc script called from cron In-Reply-To: <19980525023525.59886@pandora> References: <19980525023525.59886@pandora> X-Mailer: VM 6.30 under Emacs 19.34.1 > This script works fine when called from the command line but when run > from cron nothing is returned in the variable $res. Is $PATH set correctly when run from cron? Usually, cron only provides a bare minimum path to the programs it spawns. --p From rc-owner Thu Jun 4 20:15:24 1998 Received: from jpmorgan.com ([169.71.13.12]) by hawkwind.utcs.utoronto.ca with SMTP id <24719>; Thu, 4 Jun 1998 19:24:44 -0400 Received: (from uucp@localhost) by jpmorgan.com (8.8.5/8.8.5) id BAA17198 for ; Sun, 31 May 1998 01:57:54 -0400 (EDT) Received: from mrszip.ny.jpmorgan.com(146.149.1.249) by threshold3.jpmorgan.com via smap (4.1) id xma017169; Sun, 31 May 98 01:56:22 -0400 Received: from tok-mailhost.ja.jpmorgan.com ([169.16.62.90]) by mrszip.ny.jpmorgan.com (8.8.8/8.8.8) with ESMTP id BAA01591 for ; Sun, 31 May 1998 01:56:20 -0400 (EDT) Received: from quux.ja.jpmorgan.com (quux.ja.jpmorgan.com [169.16.7.203]) by tok-mailhost.ja.jpmorgan.com (8.7.6/8.7.3) with SMTP id OAA05048 for ; Sun, 31 May 1998 14:56:17 +0900 (JST) Received: (qmail 7229 invoked by uid 999); 31 May 1998 05:56:15 -0000 Message-ID: <19980531055615.7228.qmail@quux.ja.jpmorgan.com> From: "Noel Hunt" Date: Sun, 31 May 1998 01:56:15 -0400 To: bengt@dynas.se Subject: Re: problems with an rc script called from cron Cc: rc@hawkwind.utcs.toronto.edu > The users of rc thinks there should not be more features (I do. I would actually > like to get rid of else and reinstate ifnot). I had and interesting discussion with Byron about this when he first released rc. His response was somewhat less than favourable. From rc-owner Sun Jun 7 13:24:48 1998 Received: from knoware.nl ([193.78.121.169]) by hawkwind.utcs.utoronto.ca with SMTP id <24766>; Sun, 7 Jun 1998 12:12:39 -0400 Received: (from byron@localhost) by knoware.nl (8.8.5/8.7.3) id IAA00500; Fri, 5 Jun 1998 08:59:17 -0700 (PDT) Date: Fri, 5 Jun 1998 11:59:17 -0400 From: Byron Rakitzis Message-Id: <199806051559.IAA00500@knoware.nl> To: bengt@dynas.se, noel@jpmorgan.com Subject: Re: problems with an rc script called from cron Cc: rc@hawkwind.utcs.toronto.edu > I had and interesting discussion with Byron about this when he > first released rc. His response was somewhat less than favourable. Well, I am not sure I see any change since then that would make my opinion of "if not" more favorable. First of all, it's just the wrong way to write a conditional. It reminds me more of assembly language programming than any high level language I know! If I remember correctly Duff's paper also describes it as a bug in the language spec. Secondly, rc (my reimplementation) has been around now for 7 years and to break the syntax over a quibble like this seems to me contrary to what we've worked for to this point: a stable, reliable shell. Thirdly, I am not aware of what the state of plan 9 is these days, but I assume from a practical point of view it's at best a curiosity, and no one has ever written to me about the need for interoperating unix and plan 9 rc scripts. So I just don't see any reason to make this change. Byron. From rc-owner Tue Jul 21 13:35:05 1998 Received: from pasanda.cygnus.co.uk ([194.130.39.3]) by hawkwind.utcs.utoronto.ca with SMTP id <24794>; Tue, 21 Jul 1998 13:21:33 -0400 Received: (qmail 12910 invoked from network); 21 Jul 1998 16:17:09 -0000 Received: from jacuzzi.cygnus.co.uk (tgoodwin@194.130.39.22) by dns.cygnus.co.uk with QMTP; 21 Jul 1998 16:17:09 -0000 To: rc@hawkwind.utcs.toronto.edu Subject: Development snapshots now available Date: Tue, 21 Jul 1998 12:17:08 -0400 From: Tim Goodwin Message-ID: As an experiment, I have started making "snapshots" of the development version of rc available, so the brave and foolish can play with the latest code that I am working on. The aim of this experiment is to make the next beta release better, and happen sooner. If the snapshots don't seem to be helping towards this cause, I will abandon the experiment. The perceived problem that I'm trying to solve is this. It's a long time since I released rc-1.5b2. A number of problems, some of them serious, have come to light since that release and been fixed. However, I'm not ready to make another beta release yet. As you would expect, the snapshots come with no guarantees. Please only download them if you are interested in working with buggy code. Please don't use them to run life support machines, or nuclear power plants. If you report a bug in rc---snapshot, beta, or full release---you can expect to receive a reply saying "my fix is in the latest snapshot, please pick it up and see if it fixes your problem". I don't intend to announce every new snapshot to the list: if you want 'em, you know where to find 'em. The latest snapshot is here. As you would expect, subsequent snapshots will be in the same directory. If you don't have access to FTP, then you can't get snapshots. (Exception: if a snapshot fixes a bug that you reported, I'll figure out some way to get it to you.) ftp://ftp.cygnus.com/pub/tgoodwin/rc/snap/rc-1.5s19980721.tar.gz Any thoughts, comments, or suggestions are most welcome. Tim. From rc-owner Tue Jul 21 15:33:33 1998 Received: from ice.clark.net ([168.143.0.12]) by hawkwind.utcs.utoronto.ca with SMTP id <24694>; Tue, 21 Jul 1998 15:29:36 -0400 Received: from shell.clark.net (root@shell [168.143.0.8]) by ice.clark.net (8.8.8/8.8.8) with ESMTP id OAA19544; Tue, 21 Jul 1998 14:49:14 -0400 (EDT) Received: from shell.clark.net (culliton@localhost [127.0.0.1]) by shell.clark.net (8.8.8/8.8.8) with ESMTP id OAA16191; Tue, 21 Jul 1998 14:48:00 -0400 (EDT) Message-Id: <199807211848.OAA16191@shell.clark.net> To: Tim Goodwin cc: rc@hawkwind.utcs.toronto.edu Subject: Re: Development snapshots now available In-reply-to: Your message of "Tue, 21 Jul 1998 12:17:08 EDT." Date: Tue, 21 Jul 1998 14:48:00 -0400 From: Tom Culliton On Tue, 21 Jul 1998 12:17:08 EDT, Tim Goodwin wrote: > The perceived problem that I'm trying to solve is this. It's a long > time since I released rc-1.5b2. A number of problems, some of them > serious, have come to light since that release and been fixed. However, > I'm not ready to make another beta release yet. The last 1.5b3 we were batting around looked pretty good to me. So good that I even installed it as my standard version for everyday use. What kind of outstanding issues are left? I'll be more than happy to lend an extra eye on any remaining soft spots. > Any thoughts, comments, or suggestions are most welcome. ;-) How about, "Keep up the good work!" Seriously 1.5b3 is looking great from where I sit. Tom From rc-owner Tue Jul 28 22:29:53 1998 Received: from pasanda.cygnus.co.uk ([194.130.39.3]) by hawkwind.utcs.utoronto.ca with SMTP id <24783>; Tue, 28 Jul 1998 22:01:40 -0400 Received: (qmail 11304 invoked from network); 28 Jul 1998 17:33:37 -0000 Received: from jacuzzi.cygnus.co.uk (tgoodwin@194.130.39.22) by dns.cygnus.co.uk with QMTP; 28 Jul 1998 17:33:37 -0000 To: rc@hawkwind.utcs.toronto.edu Subject: Snapshot availability Date: Tue, 28 Jul 1998 13:33:36 -0400 From: Tim Goodwin Message-ID: The latest rc snapshot is believed to fix all reported problems. It even trips successfully under Ultrix :-). Due to family and work commitments, I won't be making another snapshot for at least a few weeks, so now would be a good time to check if it works for you. I anticipate very few changes between this snapshot and the next beta release. (But I've been wrong before.) Here's the ChangeLog for the last few days. Tim. 1998-07-23 Testing: fix silly typo in cdpath test. Configuration: `--with-vrl' added to support Gert-Jan Vons's readline library. 1998-07-24 Portability: the autoconf macro AC_FUNC_SETPGRP doesn't work on OSF1: that system supports arguments to setpgrp(), but also has a prototype in to say that it is void. Fix this by defining our own RC_FUNC_SETPGRP for now. Bug: was included twice in some source files. Configuration: automake wants `make distclean' to remove *.tab.c. Rename y.tab.[ch] to parse.[ch] to avoid this. 1998-07-27 Portability: on Ultrix, `make trip' fails with `malloc: Invalid argument'. Problem is that getgroups(0, NULL) in which.c returns -1. Add new configure test to check for POSIX getgroups() and fall back to NGROUPS if it's not available. The magic is done by "getgroups.h". Tidiness: extract magic into "wait.h". From rc-owner Mon Aug 10 17:41:11 1998 Received: from rtsl3.cs.uiuc.edu ([128.174.247.64]) by hawkwind.utcs.utoronto.ca with SMTP id <24818>; Mon, 10 Aug 1998 16:52:41 -0400 Received: (from mkgardne@localhost) by rtsl3.cs.uiuc.edu (8.8.7/8.8.7) id MAA24930; Sat, 8 Aug 1998 12:17:44 -0500 Date: Sat, 8 Aug 1998 13:17:44 -0400 Message-Id: <199808081717.MAA24930@rtsl3.cs.uiuc.edu> From: "Mark K. Gardner" To: rc@hawkwind.utcs.toronto.edu Subject: RC shell mode? Reply-to: mkgardne@cs.uiuc.edu Has anyone hacked an RC shell mode for GNU emacs? In particular, it should recognize that `{...} instead of Shell mode's `...`. I am sure that there are other differences, but that was the one I recently discovered. Mark -- Mark K. Gardner (mkgardne@cs.uiuc.edu) University of Illinois at Urbana-Champaign Real-Time Systems Laboratory -- From rc-owner Thu Oct 15 00:56:33 1998 Received: by hawkwind.utcs.utoronto.ca via suspension id <24791>; Thu, 15 Oct 1998 00:36:39 -0400 Received: from pantransit.reptiles.org ([209.157.136.18]) by hawkwind.utcs.utoronto.ca with SMTP id <24673>; Sat, 10 Oct 1998 18:56:11 -0400 Received: (qmail 7562 invoked by uid 204); 8 Oct 1998 19:22:50 -0000 Date: Thu, 8 Oct 1998 15:22:50 -0400 Message-ID: <19981008192250.7561.qmail@pantransit.reptiles.org> From: smarry@vex.net To: rc@hawkwind.utcs.toronto.edu Subject: Fwd: Good way to kill your workstation using rc(1) >From real-smarry@vex.net Thu Oct 08 17:33:11 1998 From: Wayne Hayes Subject: Good way to kill your workstation using rc(1) Date: Thu, 8 Oct 1998 13:27:31 -0400 I just accidentally found a nifty way to run an infinite loop in rc(1). I was LaTeX'ing up a theorem from my thesis, and typed: dvix theorem1 &- (the '-' was an accident). So of course it ran dvix in the background, then ran '-' with no arguments... and looped. Took me a few tries to get back to the xterm and hit ^C frantically as my screen filled up with dvix's... From rc-owner Thu Oct 22 17:28:09 1998 Received: from tikka.cygnus.co.uk ([194.130.39.2]) by hawkwind.utcs.utoronto.ca with SMTP id <24889>; Thu, 22 Oct 1998 17:07:14 -0400 Received: (qmail 744 invoked from network); 21 Oct 1998 15:10:54 -0000 Received: from jacuzzi.cygnus.co.uk (tgoodwin@194.130.39.22) by tikka.cygnus.co.uk with QMTP; 21 Oct 1998 15:10:54 -0000 To: rc@hawkwind.utcs.toronto.edu Subject: New rc snapshot available Date: Wed, 21 Oct 1998 11:10:33 -0400 From: Tim Goodwin Message-ID: <7hsAAH75LTZFlQUA@nan.cygnus.co.uk> A new snapshot is available from here. ftp://ftp.cygnus.com/pub/tgoodwin/rc/snap/rc-1.5s19981021.tar.gz I hope that this will be the last snapshot before another beta release, but we'll see... :-) The only significant code change since the last snapshot is to handle the case where a rogue application has set stdin (or wherever rc is reading commands from) to non-blocking mode. For example, running this program would cause previous versions of rc to exit, saying "read: Try again". In this snapshot, nothing untoward happens. /* Set stdin to nonblocking, and crash rc! */ #include #include #include #include int main(void) { int flags; flags = fcntl(0, F_GETFL); flags |= O_NONBLOCK; fcntl(0, F_SETFL, (long) flags); flags = read(0, &flags, 1); printf("read returns %d, errno == %d\n", flags, errno); return 0; } I would be grateful if people with "obscure" systems could grab this snapshot and let me know if it works: it's possible I need to add some more configury to handle variants of fcntl(), O_NONBLOCK, etc. I have tested this snapshot on SunOS 4.1.4, Solaris 2.6, RedHat 4.2, RedHat 5.1, Irix 5.3, AIX 4.1, and Ultrix 4.4. If you don't see your favourite system here, please spare a few minutes to ensure that I haven't broken anything. Thanks to Gert-Jan Vons for reporting this bug! Also, Tom Culliton has reported that recent rc snapshots fail to `make trip' on AIX 4.2 (although in normal use it apparently behaves itself). Unfortunately, I haven't been able to reproduce this on AIX 4.1, and I don't have access to an AIX 4.2 box. Tom doesn't have time to track it down. Please, please, please, any AIX 4.2 users out there, can you try this snapshot and let me know how you get on? Thanks, Tim. From rc-owner Wed Oct 28 19:52:26 1998 Received: from tikka.cygnus.co.uk ([194.130.39.2]) by hawkwind.utcs.utoronto.ca with SMTP id <25035>; Wed, 28 Oct 1998 18:41:30 -0500 Received: (qmail 29078 invoked from network); 28 Oct 1998 14:54:53 -0000 Received: from jacuzzi.cygnus.co.uk (tgoodwin@194.130.39.22) by tikka.cygnus.co.uk with QMTP; 28 Oct 1998 14:54:53 -0000 To: rc@hawkwind.utcs.toronto.edu Subject: New rc snapshot available (1998-10-28) Date: Wed, 28 Oct 1998 09:54:32 -0500 From: Tim Goodwin Message-ID: A new snapshot of rc is available from here. ftp://ftp.cygnus.com/pub/tgoodwin/rc/snap/rc-1.5s19981028.tar.gz Nothing too major has changed, although rc has just acquired its first idiom from C 9x! (With suitable autoconfiscation for older systems.) Relevant ChangeLog entries are appended. Thanks to Bengt Kleberg and Jeremy Fitzhardinge for reporting problems with the previous snapshot. Tim. 1998-10-22 Tidiness: makenonblock() was a rather poor choice of name for a function which makes a file descriptor *not* nonblocking :-). 1998-10-26 Portability: apparently some systems declare `char *basename(const char *)' in system header files. Changing our basename() (in history.c) to match this prototype allows it to be compiled on such systems, and is harmless. (Harmless, that is, if no system declares `char *basename(char *)'.) 1998-10-28 Bug: system-bsd.c needs to include "wait.h". Warnings: some versions of gcc warn about "ambiguous" `else' clauses. Portability: assigning va_list objects doesn't work everywhere (Linux on the PowerPC, specifically). Use the C 9x invention va_copy() instead, if it exists, otherwise fall back to assignment. Documentation: help HP-UX users by mentioning that you need `cc -Ae'. Also, HP-UX make will build rc in a separate directory. Tidiness: remove unused functions from print.c. Anybody wanting to use this library in another project should follow the pointer in the documentation to an improved version. From rc-owner Mon Nov 2 20:04:08 1998 Received: from tikka.cygnus.co.uk ([194.130.39.2]) by hawkwind.utcs.utoronto.ca with SMTP id <24791>; Mon, 2 Nov 1998 19:03:25 -0500 Received: (qmail 23090 invoked from network); 29 Oct 1998 15:21:35 -0000 Received: from jacuzzi.cygnus.co.uk (tgoodwin@194.130.39.22) by tikka.cygnus.co.uk with QMTP; 29 Oct 1998 15:21:35 -0000 To: rc@hawkwind.utcs.toronto.edu Subject: New rc snapshot available (1998-10-29) Date: Thu, 29 Oct 1998 10:21:13 -0500 From: Tim Goodwin Message-ID: <2jQAAP6HODb+QgsA@jacuzzi.cygnus.co.uk> A new snapshot of rc is available from here. ftp://ftp.cygnus.com/pub/tgoodwin/rc/snap/rc-1.5s19981029.tar.gz The changes in this snapshot are listed below. Thanks to Gert-Jan Vons and David Swasey for reporting these problems. I'm pushing them out rapidly at the moment, as I want to get another beta release wrapped up very soon. I hope nobody's suffering snapshot fatigue! Tim. 1998-10-29 Bug: the "null character ignored" warning was printed with the wrong line number. Fix by adding an offset argument to pr_error. Portability: work around readline's broken treatment of a non-blocking input file descriptor. Testing: add `testing' auxiliary program; use `testing' to generate null character on the fly (since it's a nuisance having a literal null character in trip.rc); reset sigexit in `fn fail'; add test for nonblocking input file descriptor; fix test for cdpath. Portability: include before . From rc-owner Mon Dec 7 17:55:33 1998 Received: from apollo.le.ac.uk ([143.210.16.125]) by hawkwind.utcs.utoronto.ca with SMTP id <24791>; Mon, 7 Dec 1998 17:28:44 -0500 Received: from ltsun0.star.le.ac.uk ([143.210.36.50] helo=ltsun0.le.ac.uk) by apollo.le.ac.uk with smtp (Exim 2.05 #2) id 0zlzAq-000295-00 for rc@hawkwind.utcs.utoronto.ca; Fri, 4 Dec 1998 17:37:48 +0000 To: rc@hawkwind.utcs.utoronto.ca Subject: New snapshot available Date: Fri, 4 Dec 1998 12:39:54 -0500 From: Tim Goodwin Message-ID: Another rc snapshot is available from here. http://www.star.le.ac.uk/~tjg/rc/snap/rc-1.5s19981204.tar.gz There are very few changes since the last snapshot; in fact they are all in history.c. If you use the auxiliary history programs (`-', `--p' etc.) please try this snapshot to make sure I haven't goofed. The rc maintainer's page has moved to here. Please let me know if you encounter any problems with it. http://www.star.le.ac.uk/~tjg/rc/ Tim. 1998-10-30 Portability: rename basename() to rc_basename(), since the former is quite widespread, and has a variety of different definitions (none of them, of course, static). Portability: work around i386 GCC 2.7.2.3 optimization bug triggered by a (really quite simple) expression in history.c. 1998-12-04 Bug: a debugging statement was left in history.c by mistake. Bug: `history' needs to check for `me' character preceded by `/', as well as all the other options. An invocation like ../rc-1.5/- no longer loops. Documentation: it seems better to have but a single URL in the README file, which indirects to the other places of interest. From rc-owner Sat Dec 12 02:38:08 1998 Received: from apollo.le.ac.uk ([143.210.16.125]) by hawkwind.utcs.utoronto.ca with SMTP id <25018>; Sat, 12 Dec 1998 01:40:03 -0500 Received: from ltsun0.star.le.ac.uk ([143.210.36.50] helo=ltsun0.le.ac.uk) by apollo.le.ac.uk with smtp (Exim 2.05 #2) id 0zoW1h-0005HG-00 for rc@hawkwind.utcs.utoronto.ca; Fri, 11 Dec 1998 17:06:49 +0000 To: rc@hawkwind.utcs.utoronto.ca Subject: New snapshot rc-1.5s19981211 available Date: Fri, 11 Dec 1998 12:09:05 -0500 From: Tim Goodwin Message-ID: A new snapshot is available from here. http://www.star.le.ac.uk/~tjg/rc/snap/rc-1.5s19981211.tar.gz Changes since the last snapshot are below. There is a known problem when trying to include non-standard library search paths with the HP-UX compiler; I believe this is an autoconf bug, but will keep you posted. Tim. 1998-12-08 Portability: use AM_PROG_CC_STDC. This obviates the need for a special hack on HP-UX. Documentation: document all the flags to `whatis'. 1998-12-09 Tidiness: latest autoconf version has fixed AC_FUNC_SETPGRP, so we no longer need to supply our own. Portability: test for va_copy() needs to include . 1998-12-10 Tidiness: move most of the configure.in nastiness into acinclude.m4. From rc-owner Mon Dec 28 21:46:27 1998 Received: from apollo.le.ac.uk ([143.210.16.125]) by hawkwind.utcs.utoronto.ca with SMTP id <24967>; Mon, 28 Dec 1998 20:19:53 -0500 Received: from happy.star.le.ac.uk ([143.210.36.58]) by apollo.le.ac.uk with smtp (Exim 2.05 #2) id 0zsUOo-000613-00 for rc@hawkwind.utcs.utoronto.ca; Tue, 22 Dec 1998 16:11:06 +0000 Received: (qmail 13453 invoked from network); 22 Dec 1998 16:11:31 -0000 Received: from ltsun0.star.le.ac.uk (HELO ltsun0) (tjg@143.210.36.50) by happy.star.le.ac.uk with SMTP; 22 Dec 1998 16:11:31 -0000 To: rc@hawkwind.utcs.utoronto.ca Subject: New snapshot available 1998-12-22 Date: Tue, 22 Dec 1998 11:12:37 -0500 From: Tim Goodwin Message-ID: The last snapshot of 1998 fixes all reported bugs in rc. Unless testing (mine and yours!) turns up any problems, this will become a beta release early in 1999. http://www.star.le.ac.uk/~tjg/rc/snap/rc-1.5s19981222.tar.gz There are no ChangeLog entries for this snapshot, since nothing in rc has changed. However, Makefile.in and configure have been rebuilt using fixed versions of automake and autoconf. Hope you all have a good winter break! See you next year, Tim. From rc-owner Thu Jan 14 01:10:35 1999 Received: from apollo.le.ac.uk ([143.210.16.125]) by hawkwind.utcs.utoronto.ca with SMTP id <24881>; Thu, 14 Jan 1999 00:27:50 -0500 Received: from happy.star.le.ac.uk ([143.210.36.58]) by apollo.le.ac.uk with smtp (Exim 2.05 #2) id 0zzkUM-00077a-00 for rc@hawkwind.utcs.utoronto.ca; Mon, 11 Jan 1999 16:46:50 +0000 Received: (qmail 1453 invoked from network); 11 Jan 1999 16:47:09 -0000 Received: from ltsun0.star.le.ac.uk (HELO ltsun0) (tjg@143.210.36.50) by happy.star.le.ac.uk with SMTP; 11 Jan 1999 16:47:09 -0000 To: rc@hawkwind.utcs.utoronto.ca Subject: Beta release rc-1.5b4 Date: Mon, 11 Jan 1999 11:49:52 -0500 From: Tim Goodwin Message-ID: I am delighted to announce, at long last, a new beta release of rc. I've attached the NEWS file from the release below. This is, I hope, a stable, solid release. I would encourage everyone to use it, and let me know if there are any problems that I've missed. You can obtain it from here. http://www.star.le.ac.uk/~tjg/rc/beta/rc-1.5b4.tar.gz Or, if you don't have gzip handy, the uncompressed tarball is here. http://www.star.le.ac.uk/~tjg/rc/beta/rc-1.5b4.tar If you are unable to use HTTP to obtain rc, please let me know and we'll figure out some way to get it to you. Many thanks to all the people who have contributed to this release, by suggesting ideas, contributing code, or giving feedback on snapshot releases. Tim. Since rc-1.5b2 was released, many fixes have been made to the autoconfiguration code, some of them critical. One problem (which I introduced) was found in minutes with ElectricFence: I had spent several hours failing to find it with other tools. Two bugs in rc itself, one of them trivial, were fixed. rc now uses GNU automake. Although I feel that automake is sticking plaster to mend a broken leg, it has made my job as maintainer easier. (Errm, apart from tracking down bugs in automake itself, and Perl, that is.) For people building rc, it's now possible (depending on your flavour of `make') to build in a separate directory from the source. Creeping featurism: rc now has a `-V' switch to report its version number. The detection of signal names has been completely revised. Vincent Broman suggested this, and contributed mksignal.c. The interaction with readline has been redone, principally to work around bugs in the readline library. Tom Culliton persuaded me of the need for this, and his patches to an earlier version of rc became readline.c. I rewrote addon.[ch] to provide a more useful example of adding extra builtins. The rc build system no longer considers running `yacc': parse.y is for information only. The supplied y.tab.[ch] were built with Berkeley `yacc', and lightly edited to remove a few gcc warnings. This idea was suggested by Gert-Jan Vons. Binaries of rc-1.5b4 are typically a few kilobytes smaller than 1.5b2. I believe this is due to improved autoconfiguration: we are now much more careful only to include code that will be used. Support for vrl (another lightweight "readline"-style library) was added. rc can now deal with a bogus application that sets its stdin to non-blocking mode. See ChangeLog for more details. What happened to rc-1.5b3? There were a couple of releases to people who'd found bugs in rc-1.5b2 that were called b3. To avoid any possibility of confusion, I have named this beta release rc-1.5b4. Tim Goodwin 1999-01-11 From rc-owner Wed Jan 20 19:21:51 1999 Received: from apollo.le.ac.uk ([143.210.16.125]) by hawkwind.utcs.utoronto.ca with SMTP id <25128>; Wed, 20 Jan 1999 18:50:07 -0500 Received: from happy.star.le.ac.uk ([143.210.36.58]) by apollo.le.ac.uk with smtp (Exim 2.05 #2) id 102uaU-0005un-00 for rc@hawkwind.utcs.utoronto.ca; Wed, 20 Jan 1999 10:10:14 +0000 Received: (qmail 13725 invoked from network); 20 Jan 1999 10:10:32 -0000 Received: from ltsun0.star.le.ac.uk (HELO ltsun0) (tjg@143.210.36.50) by happy.star.le.ac.uk with SMTP; 20 Jan 1999 10:10:32 -0000 To: rc@hawkwind.utcs.utoronto.ca Subject: Anybody use `rc -s'? Date: Wed, 20 Jan 1999 05:13:29 -0500 From: Tim Goodwin Message-ID: A discussion has arisen between myself and a trusty beta tester over the `-s' flag. This flag was new (and undocumented) in rc-1.5betadev1; it causes rc to put any arguments into $* (instead of treating them as files to be read); rc then reads from standard input. At present, `-s' implies `-i', and we suspect that this is wrong. I would be interested to hear from anybody who is actually using `rc -s' (or `sh -s', for that matter), since we're having trouble coming up with any realistic examples. Any comments appreciated. Tim. P.S. I've received a small amount of feedback on rc-1.5b4, which has all been positive. More feedback (especially if you've run into problems with it) is always welcome! From rc-owner Thu Jan 21 16:21:47 1999 Received: from bio.cse.psu.edu ([130.203.12.17]) by hawkwind.utcs.utoronto.ca with SMTP id <24694>; Thu, 21 Jan 1999 15:43:03 -0500 Received: (qmail 7479 invoked by uid 991); 21 Jan 1999 00:53:37 -0000 Message-ID: <19990121005337.7478.qmail@g.bio.cse.psu.edu> Date: Wed, 20 Jan 1999 19:53:37 -0500 to: rc@hawkwind.utcs.toronto.edu Subject: Re: Anybody use `rc -s'? In-reply-to: Your message of "Wed, 20 Jan 1999 05:13:29 EST." Date: Wed, 20 Jan 1999 19:53:37 -0500 From: Scott Schwartz Tim Goodwin writes: | A discussion has arisen between myself and a trusty beta tester over | the `-s' flag. This flag was new (and undocumented) in rc-1.5betadev1; | it causes rc to put any arguments into $* (instead of treating them as | files to be read); rc then reads from standard input. Was it really introduced that late? I thought it had been there earlier. | At present, `-s' implies `-i', and we suspect that this is wrong. I | would be interested to hear from anybody who is actually using `rc -s' | (or `sh -s', for that matter), since we're having trouble coming up with | any realistic examples. I don't have any examples at hand, but I vaguely remember badly wanting that flag for something interesting. It shouldn't imply `-i', though. From rc-owner Wed Jan 27 17:55:18 1999 Received: from apollo.le.ac.uk ([143.210.16.125]) by hawkwind.utcs.utoronto.ca with SMTP id <25440>; Wed, 27 Jan 1999 17:00:14 -0500 Received: from happy.star.le.ac.uk ([143.210.36.58]) by apollo.le.ac.uk with smtp (Exim 2.05 #2) id 105XRn-0006J2-00 for rc@hawkwind.utcs.utoronto.ca; Wed, 27 Jan 1999 16:04:07 +0000 Received: (qmail 11730 invoked from network); 27 Jan 1999 16:04:22 -0000 Received: from ltsun0.star.le.ac.uk (HELO ltsun0) (tjg@143.210.36.50) by happy.star.le.ac.uk with SMTP; 27 Jan 1999 16:04:22 -0000 To: rc@hawkwind.utcs.utoronto.ca Subject: Beta release rc-1.5b5 Date: Wed, 27 Jan 1999 11:07:32 -0500 From: Tim Goodwin Message-ID: A new beta release of rc is available, rc-1.5b5. Only a couple of minor changes have been made since rc-1.5b4 (see below for details). If you grabbed the previous beta, don't bother with this one (unless you're particularly keen :-). If you have a few minutes, I'd encourage you to "try something new" with this rc beta to help me shake out any remaining problems. Maybe build it for a strange machine; read the man page, or the installation documentation, or my web page; use a feature or compile time option you're not familiar with and see if it behaves as you expect. Let me know how you get on. You can obtain rc from here. http://www.star.le.ac.uk/~tjg/rc/beta/rc-1.5b5.tar.gz If you don't have gzip handy, remove the `.gz' for an uncompressed tarball. If you are unable to use HTTP to obtain rc, please contact me and we'll figure out some way to get it to you. Thanks to all the people who have contributed to this release, by suggesting ideas, contributing code, or giving feedback on earlier releases. Tim. 1999-01-19 Documentation: document the `-s' option. Also, arrange the option documentation in alphabetical order. Tidiness: just install `history' to `$(bindir)/-'; don't create an extra link (which `make clean' failed to remove). 1999-01-22 Bug: `-s' should not imply `-i'. Testing: add regression test for `-s' behaviour. 1999-01-27 Documentation: default path was out of date; minor consistency improvements. Release: rc-1.5b5. From rc-owner Thu May 6 15:48:35 1999 Received: from apollo.le.ac.uk ([143.210.16.125]) by hawkwind.utcs.utoronto.ca with SMTP id <25018>; Thu, 6 May 1999 15:40:46 -0400 Received: from happy.star.le.ac.uk ([143.210.36.58]) by apollo.le.ac.uk with smtp (Exim 2.12 #1) id 10fQcV-0007MM-00 for rc@hawkwind.utcs.utoronto.ca; Thu, 6 May 1999 17:03:31 +0100 Received: (qmail 22798 invoked from network); 6 May 1999 16:03:54 -0000 Received: from ltsun0.star.le.ac.uk (HELO ltsun0) (tjg@143.210.36.50) by happy.star.le.ac.uk with SMTP; 6 May 1999 16:03:54 -0000 To: rc@hawkwind.utcs.utoronto.ca Subject: New snapshot rc-1.5s19981211 available Date: Thu, 6 May 1999 12:03:52 -0400 From: Tim Goodwin Message-ID: A new snapshot is available from here. http://www.star.le.ac.uk/~tjg/rc/snap/rc-1.5s19990506.tar.gz Changes since the last beta are below. If anyone has Debian Linux handy, please can you try this snapshot, and confirm that, when configuring with readline, it correctly picks up `-lncurses'. Also, if anybody is using the new release of readline, readline-4.0, I'd be interested to hear from you. I've tried it myself, and it seems to work, but more testing is always appreciated. Tim. 1999-02-15 Portability: AM_INIT_AUTOMAKE calls AC_ARG_PROGRAM and AC_PROG_INSTALL. Don't do it explicitly. For once, the configure script gets smaller! Program name transformations work right now. Documentation: note that rc has no `set' builtin; fix weird variable name example; any character except `=' may be used in a variable name; document bqstatus; document rc's exit status; other tidying. 1999-03-01 Documentation: document the yacc-imposed limit on ; separated commands in a line. 1993-05-06 Portability: tgetent() might be in -lncurses instead of -ltermcap. From rc-owner Fri May 7 02:09:38 1999 Received: from elysium.uwa.edu.au ([130.95.128.2]) by hawkwind.utcs.utoronto.ca with SMTP id <24945>; Fri, 7 May 1999 01:51:20 -0400 Received: from typhaon.ucs.uwa.edu.au (root@typhaon.ucs.uwa.edu.au [130.95.128.64]) by elysium.uwa.edu.au (8.8.7/8.8.0) with ESMTP id LAA16642; Fri, 7 May 1999 11:58:12 +0800 (WST) Received: from typhaon.ucs.uwa.edu.au (luyer@localhost [127.0.0.1]) by typhaon.ucs.uwa.edu.au (8.9.3/8.9.3/Debian/GNU) with ESMTP id LAA26862; Fri, 7 May 1999 11:58:12 +0800 Message-Id: <199905070358.LAA26862@typhaon.ucs.uwa.edu.au> X-Mailer: exmh version 2.0.2 2/24/98 (debian) To: Tim Goodwin Cc: rc@hawkwind.utcs.toronto.edu Subject: Re: New snapshot rc-1.5s19981211 available In-reply-to: Your message of "Thu, 06 May 1999 12:03:52 -0400." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 6 May 1999 23:58:11 -0400 From: David Luyer > If anyone has Debian Linux handy, please can you try this snapshot, and > confirm that, when configuring with readline, it correctly picks up > `-lncurses'. Debian Linux now has at least one problem - there's no names for singals in /usr/include/asm/singal.h (just numbers!) Also, last time I compiled a new rc, this hit me: #define _NSIG 32 #define NSIG _NSIG (the script tries to work out how many signals) It would be nice to get a message for programs exiting on signals once again (long ago I made my rc compile with names for all 31 signals defined under Linux; current Debian packages don't give messages for many if any). David. PS: I did an rc port to BeOS mwcc recently, but won't bother submitting the changes, since BeOS have dropped mwcc I believe and making it work under that was ugly. One thing that showed up which might be useful is #ifndef SIGCHLD #define SIGCHLD SIGCLD #endif From rc-owner Thu May 13 17:09:50 1999 Received: from apollo.le.ac.uk ([143.210.16.125]) by hawkwind.utcs.utoronto.ca with SMTP id <24908>; Thu, 13 May 1999 17:01:05 -0400 Received: from happy.star.le.ac.uk ([143.210.36.58]) by apollo.le.ac.uk with smtp (Exim 2.12 #1) id 10hx6Z-0002GE-00 for rc@hawkwind.utcs.utoronto.ca; Thu, 13 May 1999 16:08:59 +0100 Received: (qmail 24905 invoked from network); 13 May 1999 15:09:20 -0000 Received: from ltpcg.star.le.ac.uk (tjg@143.210.36.203) by happy.star.le.ac.uk with SMTP; 13 May 1999 15:09:20 -0000 To: rc@hawkwind.utcs.utoronto.ca Subject: Beta release rc-1.5b6 Date: Thu, 13 May 1999 11:09:18 -0400 From: Tim Goodwin Message-ID: A new beta release of rc is available, rc-1.5b6. Details of changes since rc-1.5b5 are below. There are no known outstanding problems with this beta. Unless anybody can give me a reason not to, I will make the full release of rc-1.6 in a week or two's time. So this is your last chance to test rc before a major release (I'd particularly appreciate confirmation that the configure script now finds tgetent() in -lncurses on Debian Linux). You can obtain rc from here. http://www.star.le.ac.uk/~tjg/rc/beta/rc-1.5b6.tar.gz If you don't have gzip handy, remove the `.gz' for an uncompressed tarball. If you are unable to use HTTP to obtain rc, please contact me and we'll figure out some way to get it to you. Thanks to all the people who have contributed to this release, by suggesting ideas, contributing code, or giving feedback on earlier releases. Tim. 1999-02-15 Portability: AM_INIT_AUTOMAKE calls AC_ARG_PROGRAM and AC_PROG_INSTALL. Don't do it explicitly. For once, the configure script gets smaller! Program name transformations work right now. Documentation: note that rc has no `set' builtin; fix weird variable name example; any character except `=' may be used in a variable name; document bqstatus; document rc's exit status; other tidying. 1999-03-01 Documentation: document the yacc-imposed limit on ; separated commands in a line. 1999-05-06 Portability: tgetent() might be in -lncurses instead of -ltermcap. 1999-05-10 Portability: Linux *almost* has SysV SIGCLD semantics, and we need to detect them. Bug: if we reset SIGCLD to SIG_DFL, we need to record the fact in the sighandlers[] array. 1999-05-12 Documentation: note that `$(a.b)' syntax only mostly works, and that list definitions in exported functions are noisier than they need to be. Release: rc-1.5b6. From rc-owner Sat May 29 22:15:41 1999 Received: from apollo.le.ac.uk ([143.210.16.125]) by hawkwind.utcs.utoronto.ca with SMTP id <24842>; Sat, 29 May 1999 21:55:53 -0400 Received: from happy.star.le.ac.uk ([143.210.36.58]) by apollo.le.ac.uk with smtp (Exim 2.12 #1) id 10nNDw-0005A7-00 for rc@hawkwind.utcs.utoronto.ca; Fri, 28 May 1999 15:03:00 +0100 Received: (qmail 28652 invoked from network); 28 May 1999 14:03:21 -0000 Received: from ltpcg.star.le.ac.uk (tjg@143.210.36.203) by happy.star.le.ac.uk with SMTP; 28 May 1999 14:03:21 -0000 To: rc@hawkwind.utcs.utoronto.ca Subject: Release of rc-1.6 Date: Fri, 28 May 1999 10:03:21 -0400 From: Tim Goodwin Message-ID: I am delighted to announce, at long last, a new full release of rc. I've included the NEWS file from the distribution below. This is intended to summarize all the changes since the last full release, rc-1.4, about 8 years ago. It is remarkable, and a testament to the quality of rc-1.4, that so little has changed in the code itself over that time. You can obtain rc from here. http://www.star.le.ac.uk/~tjg/rc/release/rc-1.6.tar.gz If you don't have gzip handy, remove the `.gz' for an uncompressed tarball. If you are unable to use HTTP to obtain rc, please contact me and we'll figure out some way to get it to you. Thanks to all the people who have contributed to this release, by suggesting ideas, contributing code, or giving feedback on betas and snapshot releases. Tim. Highlights of changes since rc-1.4. See ChangeLog for further details. Portability. The major change since the last full release is that rc now uses GNU autoconf and automake. Other parts of the build process have been tidied up too, so that building rc should now be painless. It has been tested on a wide variety of Unix-like systems. Bug fixes. The following bugs have been fixed: the interaction with readline was not always correct; SIGCLD set to SIG_IGN could cause a hang; some obscure pipeline incantations could cause a hang; the `wait' builtin could become uninterruptible; an application could crash rc by making stdin nonblocking; the `-i' flag didn't work with readline; $history didn't work properly over NFS; a few memory leaks; and an off by one bug in reporting line numbers of errors. New features. The following features are new: the `-s' flag, which causes rc to read from stdin even if arguments are present; the `-V' flag, which prints a version string; $bqstatus which holds the exit status of the last backquote command; additional options to the `whatis' builtin; and support for vrl, another lightweight readline-style library. What happened to rc-1.5? A number of beta releases were made with names like rc-1.5b2, which might suggest improvements over rc-1.5. To avoid any possibility of confusion, I decided to name this release rc-1.6 instead. Tim Goodwin 1999-05-26 From rc-owner Thu Jun 10 17:30:06 1999 Received: from mail.core.genedata.com ([157.161.173.16]) by hawkwind.utcs.utoronto.ca with SMTP id <25033>; Thu, 10 Jun 1999 17:04:58 -0400 Received: from relay.ch.genedata.com (pinatubo-e0.ch.genedata.com [157.161.173.48]) by mail.core.genedata.com (8.9.3/8.9.3) with ESMTP id LAA28415 for ; Thu, 10 Jun 1999 11:48:07 +0200 Received: (from enh@localhost) by relay.ch.genedata.com (8.9.3/8.9.3) id LAA1263150 for rc@hawkwind.utcs.utoronto.ca; Thu, 10 Jun 1999 11:48:06 +0200 (CEST) Date: Thu, 10 Jun 1999 05:48:06 -0400 From: Elliott Hughes Message-Id: <199906100948.LAA1263150@relay.ch.genedata.com> To: rc@hawkwind.utcs.utoronto.ca Subject: backgrounded jobs something i had in my own hacked-about copy of Byron's rc is a line that output not just the pid of a backgrounded job, rather the string "kill %i\n", on the basis that this was the number one use of the pid. it's particularly handy in 9term, but probably just as useful in xterm. how would people feel about making this part of the distribution? i admit that it looks odd at first because traditional shells don't work like that; you probably have to know why its saying that not to be disconcerted by it, but i think its usefulness outweighs this, not least because rc users aren't likely to be neophyte shell users who want everything to be just like it is in sh (or bash these days, i suppose). Plan 9 rc doesn't do this, but that's probably because "kill %i |rc\n" would just look _too_ weird. that, or they didn't think of it. i also have a replacement for the shift built-in that does the things whose absence is listed as a bug on the man page, if anyone's interested. i used it in a big nasty rc script once, before i repented and stopped writing complicated things as shell scripts. it's only a couple of lines longer than the current builtin, and it would mean we could remove a "bug", though. [i assume i'm on this list: i subscribed but haven't seen anything. but i haven't seen anything on wilyfans in the same period, so maybe things are just quiet.] - Elliott -- "Act Swiss. Be Global." -- ABB Werbung, 1999. From rc-owner Sun Jun 13 21:38:47 1999 Received: from cheviot.ncl.ac.uk ([128.240.233.51]) by hawkwind.utcs.utoronto.ca with SMTP id <25037>; Sun, 13 Jun 1999 20:47:56 -0400 Received: from bygate.ncl.ac.uk by cheviot.ncl.ac.uk id (8.7.6/ for ncl.ac.uk) with SMTP; Fri, 11 Jun 1999 14:17:58 +0100 (BST) Received: (ngmt@localhost) by bygate.ncl.ac.uk (8.6.7/8.6.x-cf revision 8 for SunOS 4.1.x) id OAA10812; Fri, 11 Jun 1999 14:17:57 +0100 From: "Gerry.Tomlinson" Message-Id: <199906111317.OAA10812@bygate.ncl.ac.uk> Subject: Re: backgrounded jobs To: Elliott.Hughes@genedata.com (Elliott Hughes) Date: Fri, 11 Jun 1999 09:17:56 -0400 Cc: rc@hawkwind.utcs.toronto.edu In-Reply-To: <199906100948.LAA1263150@relay.ch.genedata.com> from "Elliott Hughes" at Jun 10, 99 05:48:06 am X-Mailer: ELM [version 2.4 PL23] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit > > > something i had in my own hacked-about copy of > Byron's rc is a line that output not just the pid of > a backgrounded job, rather the string "kill %i\n", on > the basis that this was the number one use of the > pid. it's particularly handy in 9term, but probably > just as useful in xterm. > > how would people feel about making this part of > the distribution? i admit that it looks odd at first > because traditional shells don't work like that; you > probably have to know why its saying that not to > be disconcerted by it, but i think its usefulness > outweighs this, not least because rc users aren't > likely to be neophyte shell users who want > everything to be just like it is in sh (or bash these > days, i suppose). who's to say kill is the number one use of the pid? there are other uses such as ps l and strace -p but i wouldn't want them displayed automatically either. gerry -- gerry.tomlinson@newcastle.ac.uk computing officer department of computing science, university of newcastle From rc-owner Sun Jun 13 21:38:54 1999 Received: from mel.alcatel.fr ([212.208.74.132]) by hawkwind.utcs.utoronto.ca with SMTP id <24931>; Sun, 13 Jun 1999 20:43:44 -0400 Received: from aifhs2.alcatel.fr (mailhub.alcatel.fr [155.132.180.80]) by mel.alcatel.fr (ALCANET/SMTP) with ESMTP id JAA11224; Fri, 11 Jun 1999 09:03:44 +0200 From: steve.kilbane@ind.alstom.com Received: from mz02world.hq.dtr.gecalsthom.fr (mz02world.dtr.gecalsthom.fr [159.217.142.45]) by aifhs2.alcatel.fr (ALCANET/SMTP2) with SMTP id KAA16734; Fri, 11 Jun 1999 10:01:29 +0200 (MET DST) Received: by mz02world.hq.dtr.gecalsthom.fr(Lotus SMTP MTA v4.6.3 (778.2 1-4-1999)) id 4125678D.0030DB22 ; Fri, 11 Jun 1999 10:02:15 +0200 X-Lotus-FromDomain: GA To: Elliott Hughes cc: rc@hawkwind.utcs.toronto.edu Message-ID: Date: Thu, 10 Jun 1999 18:00:01 -0400 Subject: Re: backgrounded jobs Mime-Version: 1.0 Content-type: text/plain; charset=us-ascii Content-Disposition: inline On 10/06/99 10:48:06 Elliott Hughes wrote: > something i had in my own hacked-about copy of > Byron's rc is a line that output not just the pid of > a backgrounded job, rather the string "kill %i\n", on > the basis that this was the number one use of the > pid. it's particularly handy in 9term, but probably > just as useful in xterm. > > how would people feel about making this part of > the distribution? Mutter, grumble. Doesn't sound right to me - not in rc. It sounds more es-ish to me. :-) Mind you, I'm the one who made Wily's no-arg Kill print a list of the likely Kill commands, so who am I to complain? And I don't even use rc, so my opinion doesn't even count. steve From rc-owner Tue Jun 15 19:26:43 1999 Received: from apollo.le.ac.uk ([143.210.16.125]) by hawkwind.utcs.utoronto.ca with SMTP id <24914>; Tue, 15 Jun 1999 17:57:04 -0400 Received: from happy.star.le.ac.uk ([143.210.36.58]) by apollo.le.ac.uk with smtp (Exim 2.12 #1) id 10tVIe-0005Vh-00 for rc@hawkwind.utcs.toronto.edu; Mon, 14 Jun 1999 12:53:12 +0100 Received: (qmail 5983 invoked from network); 14 Jun 1999 11:53:32 -0000 Received: from ltpcg.star.le.ac.uk (tjg@143.210.36.203) by happy.star.le.ac.uk with SMTP; 14 Jun 1999 11:53:32 -0000 To: Elliott Hughes CC: rc@hawkwind.utcs.toronto.edu In-Reply-To: <199906100948.LAA1263150@relay.ch.genedata.com> Subject: Re: backgrounded jobs Date: Mon, 14 Jun 1999 07:53:31 -0400 From: Tim Goodwin Message-ID: > something i had in my own hacked-about copy of > Byron's rc is a line that output not just the pid of > a backgrounded job, rather the string "kill %i\n", Does this suffice? fn prompt { if (!~ $apid $lastapid) { echo kill $apid lastapid=$apid } } > i also have a replacement for the shift built-in > that does the things whose absence is listed as > a bug on the man page, if anyone's interested. I didn't really give much thought to this; just left the "bug" in the man page. But doesn't this function come close? You can use `myshift x' to shift $x by one, or `myshift y 3' to shift $y by 3. The only flaw is that `myshift a' doesn't work. fn myshift { a=$*; *=$$a(1); shift $a(2); $a(1)=$* } Tim. From rc-owner Tue Jun 15 19:46:45 1999 Received: from mail.core.genedata.com ([157.161.173.16]) by hawkwind.utcs.utoronto.ca with SMTP id <24930>; Tue, 15 Jun 1999 17:57:39 -0400 Received: from relay.ch.genedata.com (pinatubo-e0.ch.genedata.com [157.161.173.48]) by mail.core.genedata.com (8.9.3/8.9.3) with ESMTP id PAA10846; Mon, 14 Jun 1999 15:23:54 +0200 Received: (from enh@localhost) by relay.ch.genedata.com (8.9.3/8.9.3) id PAA1469399; Mon, 14 Jun 1999 15:23:54 +0200 (CEST) Date: Mon, 14 Jun 1999 09:23:54 -0400 From: Elliott Hughes Message-Id: <199906141323.PAA1469399@relay.ch.genedata.com> To: Elliott Hughes , Tim Goodwin Subject: Re: backgrounded jobs Cc: rc@hawkwind.utcs.toronto.edu > Does this suffice? > fn prompt {if(!~ $apid $lastapid){echo kill $apid;lastapid=$apid}} i suppose so. it's a bit uglier, because rc automatically outputs the pid, but i can live with it. > I didn't really give much thought to this; just left the "bug" in the > man page. But doesn't this function come close? ... that's nasty, though, when the builtin requires so little alteration. here's a snippet from my local rc: /* drop first n (default 1) items of variable xs (default $*) */ static void b_shift(char **av) { int n = (av[1] == 0 ? 1 : a2u(av[1])); List *xs, *dollarzero; if (av[1] != 0 && av[2] != 0 && av[3] != 0) { arg_count("shift"); return; } if (n < 0) { badnum(av[1]); return; } if (av[1] == 0 || av[2] == 0) { xs = varlookup("*")->n; dollarzero = varlookup("0"); } else { xs = varlookup(av[2]); } while (xs != 0 && n != 0) { xs = xs->n; --n; } if (av[1] == 0 || av[2] == 0) { varassign("*", append(dollarzero, xs), FALSE); } else { varassign(av[2], xs, FALSE); } set(TRUE); } note that i don't consider dropping items from an empty list to be an error, in contrast to Byron's rc. i don't know why he chose to make it behave like that (Duff's doesn't, and neither do any functional programming languages I can think of). -e -- "Act Swiss. Be Global." -- ABB Werbung, 1999. From rc-owner Wed Jun 16 00:20:31 1999 Received: from smtp-out.vma.verio.net ([168.143.190.239]) by hawkwind.utcs.utoronto.ca with SMTP id <24827>; Wed, 16 Jun 1999 00:17:44 -0400 Received: from smtp-gw2.vma.verio.net ([168.143.0.22]) by smtp-out.vma.verio.net with esmtp (Exim 2.10 #1) id 10u4VU-0000zs-00; Tue, 15 Jun 1999 21:28:48 -0400 Received: from shell.clark.net (clark.net [168.143.0.8]) by smtp-gw2.vma.verio.net (8.9.3/8.9.3) with ESMTP id VAA12158; Tue, 15 Jun 1999 21:31:24 -0400 (EDT) Received: from shell.clark.net (culliton@localhost [127.0.0.1]) by shell.clark.net (8.8.8/8.8.8) with ESMTP id VAA27115; Tue, 15 Jun 1999 21:31:25 -0400 (EDT) Message-Id: <199906160131.VAA27115@shell.clark.net> To: Tim Goodwin cc: rc@hawkwind.utcs.toronto.edu Subject: Freshmeat? Date: Tue, 15 Jun 1999 21:31:25 -0400 From: Tom Culliton Just idle curiousity, but I've been wondering why rc 1.6 hasn't shown up on freshmeat.org, does a release announcement need to be submitted or something? ... Oh, and it works great so far on every platform I've tried it on. Many thanks for all the hard work. :-) Tom From rc-owner Sat Jun 19 21:41:08 1999 Received: from fw.softwell.se ([193.15.236.45]) by hawkwind.utcs.utoronto.ca with SMTP id <24824>; Sat, 19 Jun 1999 20:54:21 -0400 Received: from trillian.softwell.se (trillian.softwell.se [192.42.172.11]) by fw.softwell.se (8.8.5/8.8.5) with ESMTP id JAA21803; Wed, 16 Jun 1999 09:44:44 +0200 Received: (from bengt@localhost) by trillian.softwell.se (8.8.7/8.8.7) id JAA27552; Wed, 16 Jun 1999 09:44:42 +0200 Date: Wed, 16 Jun 1999 03:44:42 -0400 From: Bengt Kleberg Message-Id: <199906160744.JAA27552@trillian.softwell.se> To: culliton@clark.net, tjg@star.le.ac.uk Subject: Re: Freshmeat? Cc: rc@hawkwind.utcs.toronto.edu > on freshmeat.org, does a release announcement need to be submitted Yes. From rc-owner Sat Jun 19 22:03:10 1999 Received: from apollo.le.ac.uk ([143.210.16.125]) by hawkwind.utcs.utoronto.ca with SMTP id <24859>; Sat, 19 Jun 1999 20:55:30 -0400 Received: from happy.star.le.ac.uk ([143.210.36.58]) by apollo.le.ac.uk with smtp (Exim 2.12 #1) id 10uDbs-0004no-00 for rc@hawkwind.utcs.toronto.edu; Wed, 16 Jun 1999 12:12:00 +0100 Received: (qmail 25489 invoked from network); 16 Jun 1999 11:12:21 -0000 Received: from ltpcg.star.le.ac.uk (tjg@143.210.36.203) by happy.star.le.ac.uk with SMTP; 16 Jun 1999 11:12:21 -0000 In-Reply-To: <199906160131.VAA27115@shell.clark.net> Subject: Re: Freshmeat? To: rc@hawkwind.utcs.toronto.edu Date: Wed, 16 Jun 1999 07:12:21 -0400 From: Tim Goodwin Message-ID: <6n0AAJWGZzcZzAAA@ltsun0.star.le.ac.uk> > Just idle curiousity, but I've been wondering why rc 1.6 hasn't shown > up on freshmeat.org, does a release announcement need to be submitted > or something? ... I've just done this. Tim. From rc-owner Sat Jul 24 03:36:58 1999 Received: from tele-post-20.mail.demon.net ([194.217.242.20]) by hawkwind.utcs.utoronto.ca with SMTP id <25219>; Sat, 24 Jul 1999 03:01:24 -0400 Received: from mftsun1.demon.co.uk ([158.152.19.44] helo=gandalf.mft.co.uk) by tele-post-20.mail.demon.net with esmtp (Exim 2.12 #2) id 117FvK-000FIC-0K for rc@hawkwind.utcs.utoronto.ca; Thu, 22 Jul 1999 10:17:59 +0000 Received: from mftsun1.mft.co.uk by gandalf.mft.co.uk with SMTP (Microsoft Exchange Internet Mail Service Version 5.0.1458.49) id PHSDBG7S; Thu, 22 Jul 1999 11:15:52 +0100 Received: from mft.co.uk by mft.co.uk (8.8.8+Sun/SMI-SVR4) id LAA02836; Thu, 22 Jul 1999 11:18:20 +0100 (BST) Sender: mhw@mftsun1 Message-ID: <3796EFFD.E55E11CD@mft.co.uk> Date: Thu, 22 Jul 1999 06:18:37 -0400 From: "Mark H. Wilkinson" Reply-To: "Mark H. Wilkinson" Organization: MFT Computer Systems Limited X-Mailer: Mozilla 4.5 [en] (X11; I; SunOS 5.6 sun4u) X-Accept-Language: pt,en MIME-Version: 1.0 To: rc@hawkwind.utcs.utoronto.ca Subject: "dot" doesn't search path Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by mft.co.uk id LAA02836 the rc paper says . [-i] file ... file. $* is set for the duration to the reminder of the argument list following file. $path is used to search for file. Option -i indicates interactive input =AD a prompt (found in $prompt) is printed before each command is read. the Unix man page says . [-i] file [arg ...] Reads file as input to rc and executes its contents. With a -i flag, input is interactive. Thus from within a shell script, . -i /dev/tty does the ``right'' thing. note that $path isn't searched in the Unix rc. is this just an oversight? I'd certainly find it useful if it did search $path. ". /usr/local/bin/rcoraenv" is a bit of a handful. -Mark. From rc-owner Thu Nov 11 19:18:19 1999 Received: from apollo.le.ac.uk ([143.210.16.125]) by hawkwind.utcs.utoronto.ca with SMTP id <25020>; Thu, 11 Nov 1999 19:02:53 -0500 Received: from happy.star.le.ac.uk ([143.210.36.58]) by apollo.le.ac.uk with smtp (Exim 3.03 #1) id 11luG5-0005MZ-00 for rc@hawkwind.utcs.utoronto.ca; Thu, 11 Nov 1999 13:27:25 +0000 Received: (qmail 6559 invoked from network); 11 Nov 1999 13:27:47 -0000 Received: from ltpcg.star.le.ac.uk (tjg@143.210.36.203) by happy.star.le.ac.uk with SMTP; 11 Nov 1999 13:27:47 -0000 To: rc@hawkwind.utcs.utoronto.ca Subject: Beta release rc-1.6b1 Date: Thu, 11 Nov 1999 08:27:23 -0500 From: Tim Goodwin Message-ID: A new beta release of rc is available, rc-1.6b1. Details of changes since rc-1.6 are below; they are minor, and mostly concern portability to more distant cousins of Unix, such as CygWin and BeOS. http://www.star.le.ac.uk/~tjg/rc/beta/rc-1.6b1.tar.gz Please try this beta on as many wierd and wonderful systems as you can. Let me know of any problems: my aim is that `sh configure; make' should produce a working rc on any system sufficiently close to Unix to have `sh' and `make' :-). Tim. 1999-08-19 Portability: the proposed C 9x __va_copy() macro is called that, not va_copy(), as I thought. Furthermore, it is defined to be a macro, so we don't need to use autoconf to check for it. 1999-10-11 Bug: absolute globs don't need special case in doglob(). Avoids creating path names like `//tmp', which is a UNC path under CygWin. 1999-10-12 Portability: status.c assumes traditional Unix layout of 0 and 1 exit statuses in the parent, which is not shared by BeOS. Add mkstatval.c. 1999-10-13 Bug: a read(2) error in fdgchar() should call rc_raise(), not rc_exit(). This bug is easily tickled on systems (like Linux) which allow you to open(2) but not read(2) directories: `. /tmp'. In all previous versions of rc, this caused the shell to exit. Portability: use POSIX strerror() where it's available; fake it with sys_errlist[] where not. Feature: replace `-V' with `version' variable. 1999-10-14 Portability: exporting `path' causes indigestion in CygWin. Since it's virtually impossible for a child `rc' process to inherit `path' (which I consider a bug, but it's not going to be fixed now), simply don't export `path'. Portability: add /usr/bsd to default default path. Documentation: failing to search $path for a `.' command is at least an incompatibility with Tenth Edition rc, and probably a bug. 1999-11-10 Feature: make `version' a list. 1999-11-11 Documentation: when running configure, you need to set LDFLAGS for `-L' options, not LIBS. Release: rc-1.6b1. From rc-owner Sat Nov 13 18:41:53 1999 Received: from apollo.le.ac.uk ([143.210.16.125]) by hawkwind.utcs.utoronto.ca with SMTP id <24867>; Sat, 13 Nov 1999 18:22:47 -0500 Received: from happy.star.le.ac.uk ([143.210.36.58]) by apollo.le.ac.uk with smtp (Exim 3.03 #1) id 11mENr-00069L-00 for rc@hawkwind.utcs.toronto.edu; Fri, 12 Nov 1999 10:56:47 +0000 Received: (qmail 10748 invoked from network); 12 Nov 1999 10:57:10 -0000 Received: from ltpcg.star.le.ac.uk (tjg@143.210.36.203) by happy.star.le.ac.uk with SMTP; 12 Nov 1999 10:57:10 -0000 To: yann.golanski@theplanet.net Cc: rc@hawkwind.utcs.toronto.edu Subject: Re: rc feature? In-Reply-To: <19991112100634.A27688@kierun.localnet> Date: Fri, 12 Nov 1999 05:56:45 -0500 From: Tim Goodwin Message-ID: > I get the following error, when using ``='': > ; configure --prefix=/usr/local > syntax error > ; nslookup -querytype=mx 127.0.0.1 > syntax error > > Any idea how to solve this as it seem not to be covered in the man page? Yes it is... rc interprets several characters specially; special char- acters automatically terminate words. The following char- acters are special: # ; & | ^ $ = ` ' { } ( ) < > The single quote (') prevents special treatment of any character other than itself. So you just need to quote the character, like this. ; configure '--prefix=/usr/local' ; nslookup '-querytype=mx' 127.0.0.1 Tim. From rc-owner Thu Dec 9 02:34:15 1999 Received: from fw.softwell.se ([193.15.236.45]) by hawkwind.utcs.utoronto.ca with SMTP id <25129>; Thu, 9 Dec 1999 01:57:47 -0500 Received: from trillian.softwell.se (IDENT:bengt@trillian.softwell.se [192.42.172.11]) by fw.softwell.se (8.9.3/8.9.3) with ESMTP id QAA09197 for ; Wed, 8 Dec 1999 16:13:37 +0100 Received: (from bengt@localhost) by trillian.softwell.se (8.8.7/8.8.7) id QAA05638 for rc@hawkwind.utcs.utoronto.ca; Wed, 8 Dec 1999 16:13:37 +0100 Date: Wed, 8 Dec 1999 10:13:37 -0500 From: Bengt Kleberg Message-Id: <199912081513.QAA05638@trillian.softwell.se> To: rc@hawkwind.utcs.utoronto.ca Subject: what if?, suggestion to re-instate the alternative if not syntax... Would it be possible to re-instate if not, ie the weird way of writing } else { that was around in rc in the very beginning? (and still is in Plan9 rc). I ahve a very rare wish to run Plan9 rc scripts using Byrons rc. this is seldom, but if it is possible/not difficult or so, I would like suggest it. any comments? Best Wishes, Bengt =============================================================== Everything aforementioned should be regarded as totally private opinions, and nothing else. bengt@softwell.se ``His great strength is that he is uncompromising. It would make him physically ill to think of programming in C++.'' From rc-owner Thu Dec 9 02:34:20 1999 Received: from fw.softwell.se ([193.15.236.45]) by hawkwind.utcs.utoronto.ca with SMTP id <25128>; Thu, 9 Dec 1999 01:56:59 -0500 Received: from trillian.softwell.se (IDENT:bengt@trillian.softwell.se [192.42.172.11]) by fw.softwell.se (8.9.3/8.9.3) with ESMTP id QAA09184 for ; Wed, 8 Dec 1999 16:09:34 +0100 Received: (from bengt@localhost) by trillian.softwell.se (8.8.7/8.8.7) id QAA05614 for rc@hawkwind.utcs.utoronto.ca; Wed, 8 Dec 1999 16:09:34 +0100 Date: Wed, 8 Dec 1999 10:09:34 -0500 From: Bengt Kleberg Message-Id: <199912081509.QAA05614@trillian.softwell.se> To: rc@hawkwind.utcs.utoronto.ca Subject: rc error messages from scripts Greeitngs, When developing scripts I sometimes get the error message: line 25: syntax error near '(' Would it be possible to change this? Or is somebody using this information, and depending upon the layout? What I would like is scriptname:25 ; Thu, 9 Dec 1999 03:04:06 -0500 Received: from c26469-a.clnvl1.ct.home.com (147.205.108.160 [147.205.108.160]) by newton.hartwick.edu with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2448.0) id X52J43LF; Thu, 9 Dec 1999 02:52:42 -0500 Received: by c26469-a.clnvl1.ct.home.com (sSMTP sendmail emulation); Thu, 9 Dec 1999 02:52:05 -0500 Date: Thu, 9 Dec 1999 02:52:05 -0500 From: Decklin Foster To: rc@hawkwind.utcs.toronto.edu Subject: tilde featuritis alert Message-ID: <19991209025205.B305@debian> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Mutt/1.0i I'm sure this has come up before, but being a relative rc newbie, I really miss my '~' for home directory from bash. my question is, what exactly is the pattern matching '~' in rc *good* for? can't you just use 'switch' and end up with more readable code? couldn't we call it 'match'? is the lack of an sh-like '~' a personal preference of the author, or just not feasible to implement due to rc's eval-once semantics? I know i probably ought to be quiet and retrain my fingers, but old habits die hard. if i can't patch rc for this, how can i set up readline to get along with it? my problem is that readline will do tab completion on ~/wwwd if i have a directory in my home called wwwdocs. but it *won't* do anything with $home/wwwd, presumably since rc is not telling it what's in $home. i note that if I use bash, $HOME/wwwd magically becomes '/home/decklin/wwwdocs/'. bash must know how interact a little more closley with readline. While this sort of sets off my bloat detector, it's better than typing a ~, doing tab completion, and then going back and changing it to $home. One other thing - is there a replacement for the '~user' idiom? What's the rc way? grep through /etc/passwd? -- Decklin Written with Debian GNU/Linux - http://www.debian.org/ From rc-owner Thu Dec 9 03:10:05 1999 Received: from newton.hartwick.edu ([147.205.85.10]) by hawkwind.utcs.utoronto.ca with SMTP id <24768>; Thu, 9 Dec 1999 03:03:49 -0500 Received: from c26469-a.clnvl1.ct.home.com (147.205.108.160 [147.205.108.160]) by newton.hartwick.edu with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2448.0) id X52J4326; Thu, 9 Dec 1999 02:38:12 -0500 Received: by c26469-a.clnvl1.ct.home.com (sSMTP sendmail emulation); Thu, 9 Dec 1999 02:37:35 -0500 Date: Thu, 9 Dec 1999 02:37:35 -0500 From: Decklin Foster To: rc@hawkwind.utcs.toronto.edu Subject: Re: rc error messages from scripts Message-ID: <19991209023735.A305@debian> References: <199912081509.QAA05614@trillian.softwell.se> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Mutt/1.0i In-Reply-To: <199912081509.QAA05614@trillian.softwell.se>; from bengt@softwell.se on Wed, Dec 08, 1999 at 10:09:34AM -0500 Bengt Kleberg writes: > When developing scripts I sometimes get the error message: > line 25: syntax error near '(' I agree this is annoying. Equally annoying is this: ; ) syntax error ; mbogo mbogo not found I want it to print "rc: syntax error" (or better yet, "syntax error near ')'"). In general, the UNIX custom for these things is that the basename of argv[0] should be printed before the error. (Unless it's set to '-rc' for a login shell, in which case we should change it to 'rc'.) I note that bash handles segfaults as a special case, and just prints "Segmentation fault". I'd be more inclined to go for consistency and use "rc: segmentation fault". But might that cause people to think rc was segfaulting? Perhaps, "rc: segmentation fault in child proccess 1234". How's that? I'll volunteer to do the work for this, as long as Tim thinks it's a good idea. -- Decklin Written with Debian GNU/Linux - http://www.debian.org/ From rc-owner Thu Dec 9 03:10:34 1999 Received: from newton.hartwick.edu ([147.205.85.10]) by hawkwind.utcs.utoronto.ca with SMTP id <24766>; Thu, 9 Dec 1999 03:04:14 -0500 Received: from c26469-a.clnvl1.ct.home.com (147.205.108.160 [147.205.108.160]) by newton.hartwick.edu with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2448.0) id X52J43M1; Thu, 9 Dec 1999 03:00:58 -0500 Received: by c26469-a.clnvl1.ct.home.com (sSMTP sendmail emulation); Thu, 9 Dec 1999 03:00:21 -0500 Date: Thu, 9 Dec 1999 03:00:21 -0500 From: Decklin Foster To: rc@hawkwind.utcs.toronto.edu Subject: Re: what if?, suggestion to re-instate the alternative if not syntax... Message-ID: <19991209030021.C305@debian> References: <199912081513.QAA05638@trillian.softwell.se> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Mutt/1.0i In-Reply-To: <199912081513.QAA05638@trillian.softwell.se>; from bengt@softwell.se on Wed, Dec 08, 1999 at 10:13:37AM -0500 Bengt Kleberg writes: > Would it be possible to re-instate if not, ie the weird way of > writing } else { that was around in rc in the very beginning? (and > still is in Plan9 rc). I'm curious, what is this syntax? Anyway, my real question is, how important is being exactly like the original rc as a design consideration of this shell? I was recently thinking that i would have used 'foreach foo (bar)' (like Perl) instead of 'for (foo in bar)'. But you couldn't go and change it now what with all these scripts already in place. Then there's my other message about mucking with ~. I can probably find more to complain about :-) -- Decklin Written with Debian GNU/Linux - http://www.debian.org/ From rc-owner Thu Dec 9 04:27:35 1999 Received: from proxy4.ba.best.com ([206.184.139.15]) by hawkwind.utcs.utoronto.ca with SMTP id <24694>; Thu, 9 Dec 1999 04:24:12 -0500 Received: from peanut.rakitzis.com (dynamic8.pm01.san-mateo.best.com [205.149.174.8]) by proxy4.ba.best.com (8.9.3/8.9.2/best.out) with ESMTP id AAA10261; Thu, 9 Dec 1999 00:10:54 -0800 (PST) Received: (from byron@localhost) by peanut.rakitzis.com (8.8.7/8.8.7) id AAA23359; Thu, 9 Dec 1999 00:10:28 -0800 Date: Thu, 9 Dec 1999 03:10:28 -0500 From: Byron Rakitzis Message-Id: <199912090810.AAA23359@peanut.rakitzis.com> To: bengt@softwell.se, rc@hawkwind.utcs.toronto.edu Subject: Re: rc error messages from scripts >scriptname:25 This seems like a really good idea.. and as far as I know Rob spent some while reworking all the utilities so that the new format error message could be emitted. No reason why we shouldn't do the same! Byron. From rc-owner Thu Dec 9 04:28:11 1999 Received: from faui01.informatik.uni-erlangen.de ([131.188.2.1]) by hawkwind.utcs.utoronto.ca with SMTP id <24766>; Thu, 9 Dec 1999 04:24:49 -0500 Received: (from msfriedl@localhost) by faui01.informatik.uni-erlangen.de (8.8.8/8.1.16-FAU) id JAA29494; Thu, 9 Dec 1999 09:22:31 +0100 (MET) Date: Thu, 9 Dec 1999 03:22:31 -0500 From: Markus Friedl To: Decklin Foster Cc: rc@hawkwind.utcs.toronto.edu Subject: Re: what if?, suggestion to re-instate the alternative if not syntax... Message-ID: <19991209092231.B26932@faui01.informatik.uni-erlangen.de> References: <199912081513.QAA05638@trillian.softwell.se> <19991209030021.C305@debian> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <19991209030021.C305@debian>; from fosterd@hartwick.edu on Thu, Dec 09, 1999 at 03:00:21AM -0500 On Thu, Dec 09, 1999 at 03:00:21AM -0500, Decklin Foster wrote: > Bengt Kleberg writes: > > > Would it be possible to re-instate if not, ie the weird way of > > writing } else { that was around in rc in the very beginning? (and > > still is in Plan9 rc). > > I'm curious, what is this syntax? the 'if not' syntax. please read http://www.star.le.ac.uk/~tjg/rc/misc/td.html for(i){ if(test -f /tmp/$i) echo $i already in /tmp if not cp $i /tmp } > Anyway, my real question is, how > important is being exactly like the original rc as a design > consideration of this shell? I was recently thinking that i would have > used 'foreach foo (bar)' (like Perl) instead of 'for (foo in bar)'. why? this is a shell with a C-like syntax not a perl like syntax. if you want perl go and use perl. > But you couldn't go and change it now what with all these scripts > already in place. Then there's my other message about mucking with ~. > I can probably find more to complain about :-) nope, rc is perfect. From rc-owner Thu Dec 9 04:28:19 1999 Received: from faui01.informatik.uni-erlangen.de ([131.188.2.1]) by hawkwind.utcs.utoronto.ca with SMTP id <24768>; Thu, 9 Dec 1999 04:24:57 -0500 Received: (from msfriedl@localhost) by faui01.informatik.uni-erlangen.de (8.8.8/8.1.16-FAU) id JAA29722; Thu, 9 Dec 1999 09:26:04 +0100 (MET) Date: Thu, 9 Dec 1999 03:26:03 -0500 From: Markus Friedl To: Decklin Foster Cc: rc@hawkwind.utcs.toronto.edu Subject: Re: tilde featuritis alert Message-ID: <19991209092603.D26932@faui01.informatik.uni-erlangen.de> References: <19991209025205.B305@debian> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <19991209025205.B305@debian>; from fosterd@hartwick.edu on Thu, Dec 09, 1999 at 02:52:05AM -0500 On Thu, Dec 09, 1999 at 02:52:05AM -0500, Decklin Foster wrote: > I'm sure this has come up before, but being a relative rc newbie, I > really miss my '~' for home directory from bash. this has been discussed ages ago. see the mailing list archives from ftp://ftp.sys.utoronto.ca/pub/rc/rc-list ftp://ftp.sys.utoronto.ca/pub/rc/rc-list.1994.gz From rc-owner Thu Dec 9 04:28:29 1999 Received: from proxy2.ba.best.com ([206.184.139.14]) by hawkwind.utcs.utoronto.ca with SMTP id <24747>; Thu, 9 Dec 1999 04:24:41 -0500 Received: from peanut.rakitzis.com (dynamic8.pm01.san-mateo.best.com [205.149.174.8]) by proxy2.ba.best.com (8.9.3/8.9.2/best.out) with ESMTP id AAA25461; Thu, 9 Dec 1999 00:13:29 -0800 (PST) Received: (from byron@localhost) by peanut.rakitzis.com (8.8.7/8.8.7) id AAA23378; Thu, 9 Dec 1999 00:13:04 -0800 Date: Thu, 9 Dec 1999 03:13:04 -0500 From: Byron Rakitzis Message-Id: <199912090813.AAA23378@peanut.rakitzis.com> To: bengt@softwell.se, rc@hawkwind.utcs.toronto.edu Subject: Re: what if?, suggestion to re-instate the alternative if not syntax... >I ahve a very rare wish to run Plan9 rc scripts using Byrons rc. Without looking at the source, you'd have to change two things: the yacc file (and the lexer), and any "undumping" code to emit function definitions for export. The change should be trivial in both cases. The question I have is why you'd want to do this!? Are there any useful "standalone" rc scripts which are portable between plan9 and unix? From rc-owner Thu Dec 9 04:29:02 1999 Received: from janus.ocegr.fr ([194.3.183.34]) by hawkwind.utcs.utoronto.ca with SMTP id <24774>; Thu, 9 Dec 1999 04:25:06 -0500 Received: (qmail 12669 invoked from network); 9 Dec 1999 08:46:36 -0000 Received: from hydra.ocegr.fr (HELO ocegr.fr) (134.188.135.3) by janus.ocegr.fr with SMTP; 9 Dec 1999 08:46:36 -0000 Received: from alcina (alcina.ocegr.fr [134.188.136.183]) by ocegr.fr (8.8.8/8.8.8) with ESMTP id JAA11629; Thu, 9 Dec 1999 09:54:45 +0100 (MET) Message-Id: <4.2.2.19991209092255.00ae2380@mailhost.ocegr.fr> X-Sender: vons@mailhost.ocegr.fr X-Mailer: QUALCOMM Windows Eudora Pro Version 4.2.2 Date: Thu, 9 Dec 1999 03:52:35 -0500 To: rc@hawkwind.utcs.toronto.edu, Decklin Foster From: Gert-Jan Vons Subject: Re: tilde featuritis alert In-Reply-To: <19991209025205.B305@debian> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Decklin Foster wrote: >I'm sure this has come up before, but being a relative rc newbie, I >really miss my '~' for home directory from bash. my question is, what >exactly is the pattern matching '~' in rc *good* for? can't you just >use 'switch' and end up with more readable code? couldn't we call it >'match'? is the lack of an sh-like '~' a personal preference of the >author, or just not feasible to implement due to rc's eval-once >semantics? Something like "if (~ a b || ~ c d)" becomes quite messy when you only have 'switch'. >I know i probably ought to be quiet and retrain my fingers, but old >habits die hard. if i can't patch rc for this, how can i set up >readline to get along with it? my problem is that readline will do tab >completion on ~/wwwd if i have a directory in my home called >wwwdocs. but it *won't* do anything with $home/wwwd, presumably >since rc is not telling it what's in $home. I doubt you will see tilde expansion in rc anytime soon, since it doesn't go with the philosophy behind the shell (just look at the debates over 'echo' being built-in or not). The conflict with the ~ operator is another reason of course. You can get rc to expand $home (or any other environment variable) when you hit [tab] for filename completion by using the "vrl" commandline editor instead of readline. I've been thinking and discussing a bit with other rc/vrl users about adding ~ expansion to the vrl command-line editor, but it ain't that simple since there's no easy way to know whether the user wants the ~ to be the ~ operator or not. I now have the habit of typing $home/foo instead of ~/foo, or /home/user instead of ~user. Typing can be reduced by defining h=$home and using $h/foo, but I agree it is hard to change old habits :) Something that I still haven't gotten used to even after 5-6 years of using rc is the need to quote command arguments if there's an equal sign like in "dd 'if=infile' 'of=outfile'". I once asked for an extension that would allow me to do "dd if\=infile of\=outfile" but that got killed pretty fast :-/ Gert-Jan ----- "If you are good, you will be assigned all the work. If you are really good, you will get out of it." - Dilbert From rc-owner Thu Dec 9 16:24:21 1999 Received: from boing.lanl.gov ([128.165.114.197]) by hawkwind.utcs.utoronto.ca with SMTP id <24823>; Thu, 9 Dec 1999 16:22:26 -0500 Received: from boing.lanl.gov (mkg@localhost) by boing.lanl.gov (8.9.3/8.9.3) with ESMTP id JAA30396 for ; Thu, 9 Dec 1999 09:27:31 -0700 Message-Id: <199912091627.JAA30396@boing.lanl.gov> To: rc@hawkwind.utcs.toronto.edu Subject: Re: tilde featuritis alert In-Reply-To: Your message of "Thu, 09 Dec 1999 02:52:05 EST." <19991209025205.B305@debian> Date: Thu, 9 Dec 1999 11:27:30 -0500 From: "Mark K. Gardner" Hi Decklin, Welcome to rc. [clip...] > I really miss my '~' for home directory from bash. [clip...] > One other thing - is there a replacement for the '~user' idiom? > What's the rc way? grep through /etc/passwd? I have a patch to rc that adds tilde expansion for both these cases. I have also monkeyed with modifications to solve the "readline expands it but rc doesn't grok it" problem. And I have had discussions with Gert-Jan Vons, the author of vrl, about how to do tilde expansion in vrl. Based on this experience (some may say bull-headed stubborness), I make two observations. 1) Tilde expansion for rc is fundamentally hard. The primary reason is the conflict with pattern matching. Tilde is already spoken for as the pattern matching operator. Its use as a file path component will always be problematic. My implementation of tilde expansion correctly interprets "ls ~", "ls ~/foo", "ls ~mkg" or "ls ~mkg/foo" but it cannot handle "ls ~ " (note the space after the tilde). You would have to type "ls ~/" instead to disambiguate with the use of tilde as the pattern matching operator. I tried snarfing % as the expansion character for a while, as it appears to be unencumbered by prior use. Its use in the place of tilde seemed... well ugly. Especially considering that tilde is still used in emacs, which I use alot. It was confusing switching back and forth between % and ~. Perhaps I just didn't give it enough time. Maybe I could have changed emacs, I don't know. I abandoned the idea. 2) rc will never have tilde expansion as "standard equipment". The primary reason is cultural. Most of us were attracted to rc because of its simplicity. Nearly all changes are seen as creeping featuritis and soundly rejected (witness the "echo debate"). I have come to appreciate this view and even embrace it. That said, I must confess that I am still lazily using a patched version of rc with tilde expansion (along with "false", "true", "version", "test" and "C-d trapping" features). Next to the bloat caused by statically linking in GNU Readline, these features are nearly free! However, I should warn you that my New Year's resolution is to "go on a diet" by suffering through tilde withdrawals, eliminating "false" and "true", and adopting vrl. [PS: Since you are about to ask for it anyway, I am including my patch for tilde expansion. Add -DTILDEHOME to CFLAGS and recompile. I will answer simple questions, but I "...MAKE NO WARRANTY...EXPRESSED OR IMPLIED...", yada, yada, yada.] [PPS: I have been reluctant to waste bandwidth with its publication. However, the question of tilde expansion frequently keeps popping up. I hope by publishing it that requests can be answered by the archive.] Mark -- Mark K. Gardner RADIANT Team Network Engineering, CIC-5 Los Alamos National Laboratory P.O. Box 1663, M.S. K766 Los Alamos, NM 87545 Email: mkg@lanl.gov Phone: 1-505-665-4809 -- ================================ Cut here ====================================== --- rc-1.6/lex.c Fri Jul 24 09:48:27 1998 +++ rc-1.6-mkg/lex.c Mon Oct 18 13:33:34 1999 @@ -3,6 +3,12 @@ #include "rc.h" #include "parse.h" +#if defined(TILDEHOME) +# include +# include +# include +#endif /* TILDEHOME */ + /* Special characters (i.e., "non-word") in rc: \t \n # ; & | ^ $ = ~ ` ' { } @ ! ( ) < > \ @@ -33,6 +39,18 @@ int lineno; +#if defined(TILDEHOME) +const char nw[] = { + 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, /* ~ */ 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; +#else /* TILDEHOME */ const char nw[] = { 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, @@ -43,6 +61,7 @@ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; +#endif /* TILDEHOME */ const char dnw[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -97,9 +116,22 @@ checkfreecaret; w = RW; i = 0; +#if defined(TILDEHOME) + if (c == '~') { + c = gchar(); + ugchar(c); + if (c == ' ' || c == '\t') + return TWIDDLE; + c = '~'; + } +#endif /* TILDEHOME */ read: do { buf[i++] = c; +#if defined(TILDEHOME) + if (c == '?' || c == '[' || c == '*' || c == '~') +#else if (c == '?' || c == '[' || c == '*') +#endif /* TILDEHOME */ saw_meta = TRUE; if (i >= bufsize) buf = realbuf = erealloc(buf, bufsize *= 2); @@ -137,6 +169,46 @@ if (streq(buf, "while")) return WHILE; if (streq(buf, "case")) return CASE; w = RW; +#if defined(TILDEHOME) + if (buf[0] == '~') { + if (buf[1] == '\0' || buf[1] == '/') { + /* ~ or ~/... */ + char *home = varlookup("home")->w; + int hlen, blen; + hlen = strlen(home); + blen = strlen(buf) - 1; + if (i + hlen >= bufsize) { + buf = realbuf = erealloc(buf, bufsize *= 2); + } + memmove(buf + hlen, &buf[1], blen); + memmove(buf, home, hlen); + buf[blen + hlen] = '\0'; + } else if (buf[1] != '\0' && buf[1] != '/') { + /* ~username */ + char *n, name[256], *b; + struct passwd *pwentry; + n = name; + b = &buf[1]; + while (isalnum(*b)) { + *n++ = *b++; + } + *n = '\0'; + pwentry = getpwnam(name); + if (pwentry != NULL) { + char *path = pwentry->pw_dir; + int plen, blen; + plen = strlen(path); + blen = strlen(buf) - 1; + if (i + plen >= bufsize) { + buf = realbuf = erealloc(buf, bufsize *= 2); + } + memmove(buf + plen, &buf[strlen(name) + 1], blen); + memmove(buf, path, plen); + buf[blen + plen] = '\0'; + } + } + } +#endif /* TILDEHOME */ y->word.w = ncpy(buf); if (saw_meta) { char *r, *s; ================================= End Cut ====================================== From rc-owner Thu Dec 9 16:24:45 1999 Received: from newton.hartwick.edu ([147.205.85.10]) by hawkwind.utcs.utoronto.ca with SMTP id <24789>; Thu, 9 Dec 1999 16:22:17 -0500 Received: from c26469-a.clnvl1.ct.home.com (147.205.108.160 [147.205.108.160]) by newton.hartwick.edu with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2448.0) id X52J4QC7; Thu, 9 Dec 1999 09:21:05 -0500 Received: by c26469-a.clnvl1.ct.home.com (sSMTP sendmail emulation); Thu, 9 Dec 1999 09:20:32 -0500 Date: Thu, 9 Dec 1999 09:20:32 -0500 From: Decklin Foster To: rc@hawkwind.utcs.toronto.edu Subject: Re: tilde featuritis alert Message-ID: <19991209092032.A2018@debian> References: <19991209025205.B305@debian> <4.2.2.19991209092255.00ae2380@mailhost.ocegr.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Mutt/1.0i In-Reply-To: <4.2.2.19991209092255.00ae2380@mailhost.ocegr.fr>; from vons@ocegr.fr on Thu, Dec 09, 1999 at 03:52:35AM -0500 Gert-Jan Vons writes: > Something like "if (~ a b || ~ c d)" becomes quite messy when you > only have 'switch'. Ah, true. > I doubt you will see tilde expansion in rc anytime soon, since it > doesn't go with the philosophy behind the shell (just look at the > debates over 'echo' being built-in or not). Yeah, i read up on the archives and I see what you mean; I don't agree with the idea that tilde expansion makes rc more bloated or somehow doesn't 'belong' in a shell (computers are supposed to work for us, not the other way around, no?) I was just hoping that perhaps someone else who was bothered by this had already done the work of writing a patch. > I've been thinking and discussing a bit with other rc/vrl users > about adding ~ expansion to the vrl command-line editor, but it > ain't that simple since there's no easy way to know whether the user > wants the ~ to be the ~ operator or not. I bet i can get readline to do this before passing the command to rc, now that I think of this. After all, it *does* come from the people who brought you (ick) Emacs. ;-) > Something that I still haven't gotten used to even after 5-6 years > of using rc is the need to quote command arguments if there's an > equal sign like in "dd 'if=infile' 'of=outfile'". It seems to me that a simple rule would suffice here. An '=' in the first word of a command is interpreted as a metacharacter. An '=' in the rest of it is not. Oh, but there is the issue of 'foo = bar' (I find myself trying to do that frequently in sh now.) OK, an unquoted '=' is a metacharacter iff (it's part of the first word || it's the first character in the second word). That should continue to allow 'foo =bar' as well. Does lex/yacc let us do this? I'm not much of an expert there. -- Decklin Written with Debian GNU/Linux - http://www.debian.org/ From rc-owner Thu Dec 9 16:26:08 1999 Received: from adsl-216-102-199-169.dsl.snfc21.pacbell.net ([216.102.199.169]) by hawkwind.utcs.utoronto.ca with SMTP id <24824>; Thu, 9 Dec 1999 16:22:33 -0500 Received: (from haahr@localhost) by adsl-216-102-199-169.dsl.snfc21.pacbell.net (8.8.7/8.8.7) id IAA32371; Thu, 9 Dec 1999 08:48:49 -0800 X-Authentication-Warning: iadd.jivetech.com: haahr set sender to haahr@jivetech.com using -f From: Paul Haahr X-Attribution: haahr Message-Id: Date: Thu, 9 Dec 1999 11:48:49 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: Decklin Foster , Gert-Jan Vons Cc: rc@hawkwind.utcs.toronto.edu Subject: Re: tilde featuritis alert In-Reply-To: <19991209025205.B305@debian> References: <19991209025205.B305@debian> <4.2.2.19991209092255.00ae2380@mailhost.ocegr.fr> X-Mailer: VM 6.30 under Emacs 20.3.1 [I hate to jump into an incipient flame war, but...] Decklin Foster wrote: > is the lack of an sh-like '~' a personal preference of the author, or > just not feasible to implement due to rc's eval-once semantics? Tom Duff's rc (the Plan 9 version) didn't support ~, probably because none of the Bell Labs shells used ~ for home directory expansion. Byron kept just about everything the same as Duff's rc in his version, with the merciful exception of ``if not.'' And, at the time, we were both strong Bell Labs purists and mocked the people who suggested that ~-expansion was an appropriate shell feature. When we wrote es, it got almost all the features which real rc users had complained were missing in rc, in addition to the extensibility features. (Can you say ``second system effect''? I thought you could.) Of course, this includes ~-expansion. In fact, ~-expansion is configurable, so you can have it do whatever you want, including throw an error if you're offended by having the feature in the shell. These days, I use es and swear by ~-expansion. Byron never bothered to switch (why would he? rc is perfect for all practical purposes) and still wonders why anyone would want ~-expansion. And despite this major rift, we've somehow stayed friends. Gert-Jan Vons wrote > Something that I still haven't gotten used to even after 5-6 years of > using rc is the need to quote command arguments if there's an equal sign > like in "dd 'if=infile' 'of=outfile'". Me neither. I still consider it a bug in both rc and es. (An intermediate program between rc and es called hs, for ``hypothetical shell,'' actually fixed this by hacking the grammar, but I've never seen another Yacc grammar that unpleasant.* If I remember, the interactions with ^, which are already horrible, became combinatorily worse. But it definitely is possible to make it work.) > I once asked for an extension that would allow me to do "dd if\=infile > of\=outfile" but that got killed pretty fast :-/ This, actually, does work in es. --p * Ok, you're right, the C++ parsers are that bad. From rc-owner Thu Dec 9 16:27:12 1999 Received: from newton.hartwick.edu ([147.205.85.10]) by hawkwind.utcs.utoronto.ca with SMTP id <24774>; Thu, 9 Dec 1999 16:21:36 -0500 Received: from c26469-a.clnvl1.ct.home.com (147.205.108.160 [147.205.108.160]) by newton.hartwick.edu with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2448.0) id X52J4PZY; Thu, 9 Dec 1999 08:59:58 -0500 Received: by c26469-a.clnvl1.ct.home.com (sSMTP sendmail emulation); Thu, 9 Dec 1999 08:59:24 -0500 Date: Thu, 9 Dec 1999 08:59:24 -0500 From: Decklin Foster To: rc@hawkwind.utcs.toronto.edu Subject: Re: rc error messages from scripts Message-ID: <19991209085924.A1882@debian> References: <199912090829.AAA23488@peanut.rakitzis.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Mutt/1.0i In-Reply-To: <199912090829.AAA23488@peanut.rakitzis.com>; from byron@rakitzis.com on Thu, Dec 09, 1999 at 12:29:59AM -0800 Byron Rakitzis writes: > Also: in general, child processes in the foreground do not need to be > identified by their pid. It's redundant. Ah. silly me. How about changing the other messages and leaving 'segmentation fault' as a special case (ie, no argv[0])? would you welcome such a patch? -- Decklin Written with Debian GNU/Linux - http://www.debian.org/ From rc-owner Thu Dec 9 17:48:49 1999 Received: from smtp6.jps.net ([209.63.224.103]) by hawkwind.utcs.utoronto.ca with SMTP id <24747>; Thu, 9 Dec 1999 17:45:55 -0500 Received: from jps.net (IDENT:root@209-239-193-229.oak.jps.net [209.239.193.229]) by smtp6.jps.net (8.9.3/8.9.0) with ESMTP id OAA13376; Thu, 9 Dec 1999 14:06:09 -0800 (PST) Sender: root@smtp6.jps.net Message-ID: <38502853.1F2F5B28@jps.net> Date: Thu, 9 Dec 1999 17:08:19 -0500 From: kim kubik X-Mailer: Mozilla 4.08 [en] (X11; I; Linux 2.2.6 i686) MIME-Version: 1.0 To: Decklin Foster CC: rc@hawkwind.utcs.toronto.edu Subject: Re: tilde featuritis alert References: <19991209025205.B305@debian> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Decklin Foster wrote: > > I know i probably ought to be quiet and retrain my fingers, but old > habits die hard. if i can't patch rc for this, how can i set up > readline to get along with it? my problem is that readline will do tab > completion on ~/wwwd if i have a directory in my home called > wwwdocs. but it *won't* do anything with $home/wwwd, presumably > since rc is not telling it what's in $home. i note that if I use bash, > $HOME/wwwd magically becomes '/home/decklin/wwwdocs/'. bash must > know how interact a little more closley with readline. While this sort > of sets off my bloat detector, it's better than typing a ~, doing tab > completion, and then going back and changing it to $home. > Just this week I noted on Freshmeat a pgm Cle (Command Line Editor) that claims it 'provides the editing/history/completion commands of the readline package to any line-oriented Unix command.' Latest version (FWiW): ftp://kaolin.unice.fr/pub/Cle Maybe it'll help some (?). - kim From rc-owner Fri Dec 10 04:13:01 1999 Received: from proxy4.ba.best.com ([206.184.139.15]) by hawkwind.utcs.utoronto.ca with SMTP id <24783>; Fri, 10 Dec 1999 03:35:11 -0500 Received: from peanut.rakitzis.com (dynamic24.pm03.san-mateo.best.com [205.149.174.152]) by proxy4.ba.best.com (8.9.3/8.9.2/best.out) with ESMTP id XAA25165; Thu, 9 Dec 1999 23:41:18 -0800 (PST) Received: (from byron@localhost) by peanut.rakitzis.com (8.8.7/8.8.7) id XAA29337; Thu, 9 Dec 1999 23:40:39 -0800 Date: Fri, 10 Dec 1999 02:40:39 -0500 From: Byron Rakitzis Message-Id: <199912100740.XAA29337@peanut.rakitzis.com> To: fosterd@hartwick.edu, rc@hawkwind.utcs.toronto.edu Subject: Re: rc error messages from scripts > Ah. silly me. How about changing the other messages and leaving > 'segmentation fault' as a special case (ie, no argv[0])? would you > welcome such a patch? Let's see: ; ash $ ) Syntax error: ")" unexpected $ ; csh [leica@peanut]$ ) Too many )'s. [leica@peanut]$ exit ; bash bash$ ) bash: syntax error near unexpected token `)' bash$ exit ; Okay, on my own linux machine it seems only bash puts argv[0] in for its "private" error messages. You can argue about whether this is right or wrong but I don't see a compelling reason to make rc do the same thing as bash. As I mentioned before, I think there is an argument to be made for rc's errors being unadorned, as the user is in a sense engaging in a "private" conversation with rc before any forks or execs have happened. Maybe this is stretching a metaphor a little too far, but that's how I feel about these parser error messages. Byron. From rc-owner Fri Dec 10 04:13:18 1999 Received: from proxy4.ba.best.com ([206.184.139.15]) by hawkwind.utcs.utoronto.ca with SMTP id <24785>; Fri, 10 Dec 1999 03:36:56 -0500 Received: from peanut.rakitzis.com (dynamic24.pm03.san-mateo.best.com [205.149.174.152]) by proxy4.ba.best.com (8.9.3/8.9.2/best.out) with ESMTP id XAA06330; Thu, 9 Dec 1999 23:45:42 -0800 (PST) Received: (from byron@localhost) by peanut.rakitzis.com (8.8.7/8.8.7) id XAA29345; Thu, 9 Dec 1999 23:45:04 -0800 Date: Fri, 10 Dec 1999 02:45:04 -0500 From: Byron Rakitzis Message-Id: <199912100745.XAA29345@peanut.rakitzis.com> To: fosterd@hartwick.edu, rc@hawkwind.utcs.toronto.edu Subject: Re: tilde featuritis alert >It seems to me that a simple rule would suffice here. An '=' in the >first word of a command is interpreted as a metacharacter. An '=' in >the rest of it is not. Oh, but there is the issue of 'foo = bar' (I >find myself trying to do that frequently in sh now.) OK, an unquoted >'=' is a metacharacter iff (it's part of the first word || it's the >first character in the second word). That should continue to allow >'foo =bar' as well. For better or for worse, rc's grammar allows for multiple temporary assignments: ; foo=1 bar=2 echo $foo $bar 1 2 ; echo $foo $bar ; So you have to account for that as well. With sufficient tweaking to the parser and lexer perhaps you could allow unquoted '='s in a parameter list, but I tried my hand at it years ago and I wasn't able to come up with anything remotely pleasant. Byron. From rc-owner Fri Dec 10 05:08:44 1999 Received: from fw.softwell.se ([193.15.236.45]) by hawkwind.utcs.utoronto.ca with SMTP id <24767>; Fri, 10 Dec 1999 05:06:54 -0500 Received: from trillian.softwell.se (IDENT:bengt@trillian.softwell.se [192.42.172.11]) by fw.softwell.se (8.9.3/8.9.3) with ESMTP id KAA12887; Fri, 10 Dec 1999 10:00:06 +0100 Received: (from bengt@localhost) by trillian.softwell.se (8.8.7/8.8.7) id KAA13919; Fri, 10 Dec 1999 10:00:06 +0100 Date: Fri, 10 Dec 1999 04:00:06 -0500 From: Bengt Kleberg Message-Id: <199912100900.KAA13919@trillian.softwell.se> To: fosterd@hartwick.edu, rc@hawkwind.utcs.toronto.edu Subject: Re: what if?, suggestion to re-instate the alternative if not syntax... > > if not, ie the weird way of writing } else { that was around in rc in the very beginning > I'm curious, what is this syntax? 1 man page bug alert. the paper describing rc for plan9 is mentioned as included in the unix rc distro. it is not. (or I can not find it) 2 the paper can be found at http://plan9.bell-labs.com/plan9/doc/rc.html 3 the old syntax was if (test -f afile) { echo file exists } if not { echo file does not exist } From rc-owner Fri Dec 10 05:08:50 1999 Received: from janus.ocegr.fr ([194.3.183.34]) by hawkwind.utcs.utoronto.ca with SMTP id <24747>; Fri, 10 Dec 1999 05:07:01 -0500 Received: (qmail 18519 invoked from network); 10 Dec 1999 09:29:23 -0000 Received: from hydra.ocegr.fr (HELO ocegr.fr) (134.188.135.3) by janus.ocegr.fr with SMTP; 10 Dec 1999 09:29:23 -0000 Received: from alcina (alcina.ocegr.fr [134.188.136.183]) by ocegr.fr (8.8.8/8.8.8) with ESMTP id KAA28083 for ; Fri, 10 Dec 1999 10:37:32 +0100 (MET) Message-Id: <4.2.2.19991210102710.00ad3380@mailhost.ocegr.fr> X-Sender: vons@mailhost.ocegr.fr X-Mailer: QUALCOMM Windows Eudora Pro Version 4.2.2 Date: Fri, 10 Dec 1999 04:32:05 -0500 To: rc@hawkwind.utcs.toronto.edu From: Gert-Jan Vons Subject: Re: tilde featuritis alert In-Reply-To: <199912100745.XAA29345@peanut.rakitzis.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Byron Rakitzis wrote: >For better or for worse, rc's grammar allows for multiple temporary >assignments: > > ; foo=1 bar=2 echo $foo $bar > 1 2 > ; echo $foo $bar > >So you have to account for that as well. > >With sufficient tweaking to the parser and lexer perhaps you could allow >unquoted '='s in a parameter list, but I tried my hand at it years ago >and I wasn't able to come up with anything remotely pleasant. On the other hand: ; echo foo=1 bar=2 syntax error so it does detect that the assignment is not valid in this case. If it just could take the equals-sign as is... Gert-Jan ----- "A little government and a little luck are necessary in life, but only a fool trusts either of them." - P.J. O'Rourke From rc-owner Fri Dec 10 05:09:02 1999 Received: from fw.softwell.se ([193.15.236.45]) by hawkwind.utcs.utoronto.ca with SMTP id <24694>; Fri, 10 Dec 1999 05:06:36 -0500 Received: from trillian.softwell.se (IDENT:bengt@trillian.softwell.se [192.42.172.11]) by fw.softwell.se (8.9.3/8.9.3) with ESMTP id KAA12916; Fri, 10 Dec 1999 10:06:59 +0100 Received: (from bengt@localhost) by trillian.softwell.se (8.8.7/8.8.7) id KAA13965; Fri, 10 Dec 1999 10:06:58 +0100 Date: Fri, 10 Dec 1999 04:06:58 -0500 From: Bengt Kleberg Message-Id: <199912100906.KAA13965@trillian.softwell.se> To: bengt@softwell.se, byron@rakitzis.com, rc@hawkwind.utcs.toronto.edu Subject: Re: what if?, suggestion to re-instate the alternative if not syntax... > Are there any useful "standalone" rc scripts which are portable between plan9 and unix? Given the plan9 source, and a large set of patches (boddles), it woud be nice to update the source and burn a new CD-ROM. For various reasons I would prefer to burn the CD from Unix, and also load the source, do the patch on Unix. The boddles are rc scripts, which use if not. Note: I would not want to remove } else { . If not would only be a complement. Best Wishes, Bengt =============================================================== Everything aforementioned should be regarded as totally private opinions, and nothing else. bengt@softwell.se ``His great strength is that he is uncompromising. It would make him physically ill to think of programming in C++.'' From rc-owner Sun Dec 12 03:00:37 1999 Received: from apollo.le.ac.uk ([143.210.16.125]) by hawkwind.utcs.utoronto.ca with SMTP id <24767>; Sun, 12 Dec 1999 02:18:50 -0500 Received: from happy.star.le.ac.uk ([143.210.36.58]) by apollo.le.ac.uk with smtp (Exim 3.03 #1) id 11wT3A-0002vG-00 for rc@hawkwind.utcs.utoronto.ca; Fri, 10 Dec 1999 16:37:44 +0000 Received: (qmail 23052 invoked from network); 10 Dec 1999 16:38:21 -0000 Received: from ltpcg.star.le.ac.uk (tjg@143.210.36.203) by happy.star.le.ac.uk with SMTP; 10 Dec 1999 16:38:21 -0000 To: rc@hawkwind.utcs.utoronto.ca Subject: Beta release rc-1.6b2 Date: Fri, 10 Dec 1999 11:37:59 -0500 From: Tim Goodwin Message-ID: <7x0AAH0sUTjKCwIA@ltsun0.star.le.ac.uk> A new beta release of rc is available, rc-1.6b2. Details of changes since rc-1.6b1 are below. http://www.star.le.ac.uk/~tjg/rc/beta/rc-1.6b2.tar.gz You know what to do :-). Tim. 1999-12-10 Bug: absolute globs do still need a special case. `/*' works again now, but we still avoid creating names like `//tmp/foo'. Bug: avoid a putative race condition in signal.c. Documentation: extra parentheses around `~' and `!' expressions are forbidden. Tom Duff's paper is not distributed with rc, but is available on the web. Release: rc-1.6b2. From rc-owner Sun Dec 12 03:01:47 1999 Received: from apollo.le.ac.uk ([143.210.16.125]) by hawkwind.utcs.utoronto.ca with SMTP id <24768>; Sun, 12 Dec 1999 02:22:49 -0500 Received: from happy.star.le.ac.uk ([143.210.36.58]) by apollo.le.ac.uk with smtp (Exim 3.03 #1) id 11wTJj-00039r-00 for rc@hawkwind.utcs.utoronto.ca; Fri, 10 Dec 1999 16:54:51 +0000 Received: (qmail 23970 invoked from network); 10 Dec 1999 16:55:28 -0000 Received: from ltpcg.star.le.ac.uk (tjg@143.210.36.203) by happy.star.le.ac.uk with SMTP; 10 Dec 1999 16:55:28 -0000 To: rc@hawkwind.utcs.utoronto.ca Subject: rc futures Date: Fri, 10 Dec 1999 11:55:06 -0500 From: Tim Goodwin Message-ID: It's good to see some discussion on the list again. You may have noticed that recent releases of rc have changed very little; this is because I am aiming to produce a very solid rc-1.7. After that, I want to start working towards rc-2. (Or shall we call it ActiveShell 2000? :-) I have a number of ideas for changes, which are listed below. The first section comments on the items listed in the BUGS section of the man page. The second section lists other items that I have a reasonably clear idea of how to tackle. The third section is more contentious or nebulous ideas. All comments are welcome. Tim. Documented bugs 1. The ^A bug. This will be fixed. 2. Compile-time limit on `;' separated commands in a line. I think it is possible to fix this, although it may not be worth the effort. 3. Problems with FIFOs. Has anybody ever actually seen these problems? If there's a repeatable test case, I can probably fix it. 4. `shift' only works on `$*'. This could be fixed, but it's not hard to write a function that can shift any variable (except one). Suggested fix is to the documentation: include the `anyshift' function, and remove this "bug". 5. Builtin `echo'. Well, it's not going away :-). There's always the compile-time option to omit it... 6. Avoid exporting a variable: see below. 7. `$^var' to join with an arbitrary separating character. Again, this is easy to fake with a function when needed. 8 & 9. Strange handling of parentheses. I think this can be fixed with some tweaks to the grammar, and probably is worth it. 10. `$PATH' versus `$path'. I think rc should prefer `$path' if both are set. Likewise for `$cdpath' and `$home'. 11. `.' should search `$path'. This will be fixed. 12. Extra parentheses around `~' and `!' are syntax errors (you'll have to get rc-1.6b2 to see what this is about). I suspect that these "surprising" special cases can be fixed with minor tweaks to the grammar. (Suggestion due to Bengt Kleberg.) Other likely changes 13. Add the `flag' builtin as described in this document. (I've considered a few "improved" versions of this, but I think the original specification is pretty much spot on.) http://www.star.le.ac.uk/~tjg/rc/misc/td.html 14. Add a command line flag that means "don't export any variables". (Any suggestions for a mnemonic letter?) This is fairly useless on the command line, but in conjunction with `flag' solves bug 6 neatly. (Actually, the flag will probably mean "don't export any variables, except those set in temporary assignments", which is rather more useful.) 15. Fake bidirectional pipes on systems where `pipe()' produces a unidirectional pipe, but `socketpair()' exists. (Suggestion due to Charles Forsyth, via John Murdie.) 16. Make `*' match files beginning with `.' (except `.' and `..', of course). This is something of a religious question, but my feeling is that special treatment of "dot files" is a mistake. (Suggestion ditto.) 17. Improved error reporting, as discussed on the list recently. Also, I intend that rc should prefix its errors with `rc: '; the long standing Unix tradition that shells are special in this regard is not very useful, I think. 18. Support BSD editline, and clean up the readline, editline, vrl, etc. interface if possible. (Suggestion due to Raymond Venneker.) 19. Discard autoconf and automake. I wrote a long message to the <9fans> list about some of my objections to autoconf. I have a replacement system in the wings. Other possible changes. 20. ~ expansion. 21. Add a command line flag that turns off free carets. 22. Add a `sigeof' function, which is invoked when rc sees EOF on standard input when it's a terminal device. If sigeof returns 1, rc attempts to continue reading from standard input. fn sigeof { echo 'Type `exit'' to leave the shell' >[1=2]; return 1 } (Suggestion due to Mark K Gardner.) 23. Dynamically load readline only when rc is about to read from a terminal device. This would mean that a single rc binary would be lean and fast for scripts, but still do readline for interactive use. However, I suspect that the effort involved in making this happen portably would be considerable. 24. Make `$ifs' behaviour "smarter". The problem is that sometimes you want repeated separators to indicate a null value, sometimes not. ; # ifs has its default value ; x = `{ echo 'this is a test' } ; whatis x x=(this is a test) ; ifs=, ; x = `{ echo this,is,,a,test } ; whatis x x=(this is a 'test ') But in the second example, we'd really like to see this. x=(this is '' a test) One suggestion (due to Donn Cave) is to make rc use its existing rules when `$ifs' contains multiple characters, and to use "repeated separators imply null values" when `$ifs' contains only a single character. (There is a separate question of whether newlines should be trimmed in this case.) I see the problem, but I'm not keen on this solution. 25. Gert-Jan Vons complains that using `=' in a command's arguments is a syntax error. I find this frustrating, too, but I can't think of a cure that isn't worse than the disease. 26. Better testing. It bothers me that I have added 22 "Bug:" entries to the ChangeLog, but only 4 regression tests to trip.rc. To some extent, this is inevitable. It simply isn't possible for trip.rc---or any test infrastructure that can work wherever rc does---to create a file which the user is entitled to execute only because of a secondary group membership, or to construct a file which can be open()ed for reading, but not read(). But I think we should do better. A second problem with trip.rc is that it assumes certain Unixisms, so it doesn't work at all under CygWin, for instance. 27. Smaller, faster, cheaper. I don't think rc has any major inefficiencies, but I will certainly throw some profiling tools at it, to see if there are improvements to be made. In this context, "cheaper" means smaller to download, or faster to build. I think the new Makefile maker mentioned in 19 will achieve both these goals. 28. That's all for now, folks! From rc-owner Wed Dec 15 03:30:41 1999 Received: from localhost by hawkwind.utcs.utoronto.ca with SMTP id <25059>; Wed, 15 Dec 1999 03:22:52 -0500 To: rc Subject: Re: rc futures In-reply-to: tjg's message of Fri, 10 Dec 1999 11:55:06 -0500. Date: Tue, 14 Dec 1999 19:17:11 -0500 From: Chris Siebenmann Message-Id: <99Dec15.032252est.25059@hawkwind.utcs.utoronto.ca> | 10. `$PATH' versus `$path'. I think rc should prefer `$path' if both | are set. Likewise for `$cdpath' and `$home'. I disagree for the already stated reasons. $PATH is standard on Unix; when rc starts, if $PATH and $path disagree, something has fiddled with $PATH and expects the fiddling to be respected. Similarly for $HOME and $home. | 11. `.' should search `$path'. This will be fixed. If Plan 9 rc doesn't, I don't think we should either. | 16. Make `*' match files beginning with `.' (except `.' and `..', of | course). This is something of a religious question, but my feeling is | that special treatment of "dot files" is a mistake. (Suggestion ditto.) This might be a good idea in a new shell, or for rc on a new system (without the cultural history of dotfiles). I think it is a really bad idea for an existing shell on an existing system, for all the obvious reasons. I would never run a version of rc that behaved this way here. | 17. Improved error reporting, as discussed on the list recently. Also, | I intend that rc should prefix its errors with `rc: '; the long standing | Unix tradition that shells are special in this regard is not very | useful, I think. My personal opinion is that rc should report errors in a shell script marked both with rc's name and with the script's name (so that it is obvious that it is a syntax error in the script, and not an error message being emitted by the script). I think rc should retain its current way of reporting the exit status of commands run directly from an interactive session. Whether rc should print 'rc: ' in front of syntax errors during interactive sessions seems like a religious issue. In the name of minimalism, I'd vote no. - cks From rc-owner Wed Dec 15 03:34:22 1999 Received: from adsl-216-102-199-169.dsl.snfc21.pacbell.net ([216.102.199.169]) by hawkwind.utcs.utoronto.ca with SMTP id <24867>; Wed, 15 Dec 1999 03:21:57 -0500 Received: (from haahr@localhost) by adsl-216-102-199-169.dsl.snfc21.pacbell.net (8.8.7/8.8.7) id KAA05529; Mon, 13 Dec 1999 10:54:32 -0800 X-Authentication-Warning: iadd.jivetech.com: haahr set sender to haahr@jivetech.com using -f From: Paul Haahr X-Attribution: haahr Message-Id: Date: Mon, 13 Dec 1999 13:54:31 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: Tim Goodwin Cc: rc@hawkwind.utcs.toronto.edu Subject: Re: rc futures In-Reply-To: References: X-Mailer: VM 6.30 under Emacs 20.3.1 > You may have noticed that recent releases of rc have changed very > little; this is because I am aiming to produce a very solid rc-1.7. That would be great. > After that, I want to start working towards rc-2. (Or shall we call it > ActiveShell 2000? :-) Is there really a need for an rc-2? After all, what appeals to me most about the shell is its perfect minimalism -- adding any new features to rc could easily make it worse, not better. The bugs you listed as needing fixing seem reasonable, though (as you pointed out for things like the limit on ;-separated commands on a line or ``='' not used for assignment) the cure may sometimes be worse than the disease. I have some specific comments on your suggestions. > 1. The ^A bug. This will be fixed. How? With es, we use combinations of ^A and ^B, but it's at least as gross a hack as not allowing ^A. (If you do change this, unless you've got a very good reason, try to make it compatible with es.) > 8 & 9. Strange handling of parentheses. I think this can be fixed with > some tweaks to the grammar, and probably is worth it. > > 12. Extra parentheses around `~' and `!' are syntax errors (you'll > have to get rc-1.6b2 to see what this is about). I suspect that these > "surprising" special cases can be fixed with minor tweaks to the > grammar. (Suggestion due to Bengt Kleberg.) I don't understand the complaints here. These are not bugs, IMHO, just consequences of a simple grammar. Do not underestimate how complicated you will make the grammar by changing these. > 10. `$PATH' versus `$path'. I think rc should prefer `$path' if both > are set. Likewise for `$cdpath' and `$home'. I think there was a good reason for preferring $PATH: rc invokes a sh(1) script which sets $path and then invokes and rc script. Changing this behavior would be a mistake. > 11. `.' should search `$path'. This will be fixed. Why? Who uses ``.'' that frequently that it's an issues? I think the files you run with ``.'' are rarely the same programs you want to run with normal execution rules, so I'd prefer keeping it the way it is. > 13. Add the `flag' builtin as described in this document. (I've > considered a few "improved" versions of this, but I think the original > specification is pretty much spot on.) Why? Duff's rc used flag so that rcinit could be used to implement startup flag processing. It was not generally useful, just part of the bootstrap process -- do you want to change the boot process as well? > 14. Add a command line flag that means "don't export any variables". > (Any suggestions for a mnemonic letter?) This is fairly useless on > the command line, but in conjunction with `flag' solves bug 6 neatly. > (Actually, the flag will probably mean "don't export any variables, > except those set in temporary assignments", which is rather more > useful.) First, the semantics of this are hardly clear. What happens when you modify a variable which is already in the environment? Second, why bother? What need is there for this? > 15. Fake bidirectional pipes on systems where `pipe()' produces a > unidirectional pipe, but `socketpair()' exists. (Suggestion due to > Charles Forsyth, via John Murdie.) Why bother? How many times do you find programs that can communicate with the previous member of a pipeline by writing to their standard input? > 16. Make `*' match files beginning with `.' (except `.' and `..', of > course). This is something of a religious question, but my feeling is > that special treatment of "dot files" is a mistake. (Suggestion ditto.) You will alienate anyone who wants cultural compatibility with normal Unix shells. Compatibility with plan 9 is much less important, I think, than matching Unix users' expectations, especially those of us who've already been using Byron's rc since 1992. > 17. Improved error reporting, as discussed on the list recently. Also, > I intend that rc should prefix its errors with `rc: '; the long standing > Unix tradition that shells are special in this regard is not very > useful, I think. Adding the name of the script seems useful for errors reported from scripts. Adding a ``rc:'' prefix seems a mistake to me. > 19. Discard autoconf and automake. I wrote a long message to the > <9fans> list about some of my objections to autoconf. I have a > replacement system in the wings. I'm not on 9fans, so I missed your note, and I agree that the GNU tools are big and bloated, but this seems like a waste of time. > 20. ~ expansion. If you want to start a holy war, be my guest. I use ~-expansion, so I'm hardly one to complain about it. > 21. Add a command line flag that turns off free carets. This seems like a really, really bad idea to me. I used something derived from rc which didn't have free carets, and it was mighty painful. But percolating that change through the parsing system as a conditional option seems really unpleasant. The big problem with free carets is how they affect the implementation of the shell, and not its usage. You're proposing to complicate the implementation for the ``benefit'' of confusion for the end user, who now has two potential modes to run rc in. > 23. Dynamically load readline only when rc is about to read from a > terminal device. This would mean that a single rc binary would be > lean and fast for scripts, but still do readline for interactive use. > However, I suspect that the effort involved in making this happen > portably would be considerable. Ugh. All of these: > 4. `shift' only works on `$*'. This could be fixed, but it's not hard to > write a function that can shift any variable (except one). Suggested > fix is to the documentation: include the `anyshift' function, and remove > this "bug". > 6. Avoid exporting a variable: see below. > 7. `$^var' to join with an arbitrary separating character. Again, this > is easy to fake with a function when needed. > 24. Make `$ifs' behaviour "smarter". The problem is that sometimes you > want repeated separators to indicate a null value, sometimes not. [...] we ``fixed'' in es. Yes, they made the shell more general. Yes, they're used very occaisionally. But I'd be surprised to find them critical to rc. --p From rc-owner Wed Dec 15 03:34:28 1999 Received: from mail.core.genedata.com ([157.161.173.16]) by hawkwind.utcs.utoronto.ca with SMTP id <24817>; Wed, 15 Dec 1999 03:20:07 -0500 Received: from relay.core.genedata.com (nila-e0.core.genedata.com [157.161.173.44]) by mail.core.genedata.com (8.10.0.Beta10/8.10.0.Beta10) with ESMTP id dBDCtVH21743 for ; Mon, 13 Dec 1999 13:55:31 +0100 Received: from relay.ch.genedata.com (pinatubo-e0.ch.genedata.com [157.161.173.48]) by relay.core.genedata.com (8.10.0.Beta10/8.10.0.Beta10) with ESMTP id dBDCtVG07802 for ; Mon, 13 Dec 1999 13:55:31 +0100 Received: (from enh@localhost) by relay.ch.genedata.com (8.9.3/8.9.3) id NAA796539 for rc@hawkwind.utcs.utoronto.ca; Mon, 13 Dec 1999 13:55:29 +0100 (CET) Date: Mon, 13 Dec 1999 07:55:29 -0500 From: Elliott Hughes Message-Id: <199912131255.NAA796539@relay.ch.genedata.com> To: rc@hawkwind.utcs.utoronto.ca Subject: Re: rc futures re: shift, i disagree with the idea of an "anyshift" function, given that it's so easy to make an extended shift backwards-compatible. see the patch i either posted here or mailed to tim earlier this year. i seem to recall that my builtin was shorter or the same length as the current one. i think it's silly to hack around something that we can so easily and cleanly fix properly. re: dot files i agree that special treatment of dot files is mistake. re: improved error reporting this would be a great benefit. my own copy of rc is hacked to sort of do this, but it's not quite right and you're as well off doing it again from scratch (i know i would). rc should prefix its errors "rc: ". re: = in args this is a real pain, but i take your word for it that changing the interpretation of = past the first non-assignment in a line is hard. -e -- "As the Chinese say, 1001 words is worth more than a picture." -- John McCarthy From rc-owner Wed Dec 15 03:36:02 1999 Received: from proxy4.ba.best.com ([206.184.139.15]) by hawkwind.utcs.utoronto.ca with SMTP id <25026>; Wed, 15 Dec 1999 03:22:26 -0500 Received: from peanut.rakitzis.com (dynamic49.pm01.san-mateo.best.com [205.149.174.49]) by proxy4.ba.best.com (8.9.3/8.9.2/best.out) with ESMTP id BAA01104; Tue, 14 Dec 1999 01:45:59 -0800 (PST) Received: (from byron@localhost) by peanut.rakitzis.com (8.8.7/8.8.7) id BAA04801; Tue, 14 Dec 1999 01:44:19 -0800 Date: Tue, 14 Dec 1999 04:44:19 -0500 From: Byron Rakitzis Message-Id: <199912140944.BAA04801@peanut.rakitzis.com> To: rc@hawkwind.utcs.toronto.edu, tjg@star.le.ac.uk Subject: Re: rc futures A couple of comments, not exhaustive: > 12. Extra parentheses around `~' and `!' are syntax errors (you'll > have to get rc-1.6b2 to see what this is about). I suspect that these > "surprising" special cases can be fixed with minor tweaks to the > grammar. (Suggestion due to Bengt Kleberg.) They are not syntax errors -- ; while ((~ 1 1) && (~ 2 2)) {} ~ not found Parentheses introduce a word list -- a command list is introduced with {}. Thus: ; while ({! 1 1} && {! 2 2}) {} 1 not found 2 not found 1 not found 2 not found 1 not found 2 not found Maybe I don't understand the nature of the complaint. > 16. Make `*' match files beginning with `.' (except `.' and `..', of > course). This is something of a religious question, but my feeling is > that special treatment of "dot files" is a mistake. (Suggestion ditto.) I'm really unsure about the justification for this. This breaks compatability with so many versions of Unix that it really makes me wonder what the point is. Just because plan 9 doesn't have dotfiles doesn't necessarily mean we want to foist this on Unix users of rc. > 23. Dynamically load readline only when rc is about to read from a > terminal device. This would mean that a single rc binary would be > lean and fast for scripts, but still do readline for interactive use. > However, I suspect that the effort involved in making this happen > portably would be considerable. I don't even know what to say about this. The mind boggles. The idea that the readline library is so cumbersome that it needs to be dynamically loaded really weirds me out. Is it that huge now? Processors have improved by a couple orders of magnitude since I wrote rc! What if a talented programmer spent a month doing a readline replacement? Could he make it weigh in at 10% of the size of GNU readline? 5%? 1%? Sorry, it's late here and I'm babbling. Byron. From rc-owner Sun Dec 19 02:36:25 1999 Received: from smtp3.fas.harvard.edu ([140.247.30.83]) by hawkwind.utcs.utoronto.ca with SMTP id <24790>; Sun, 19 Dec 1999 02:23:06 -0500 Received: from p9rsc.cs.bell-labs.com (rcox-2.student.harvard.edu [140.247.183.206]) by smtp3.fas.harvard.edu with SMTP id LAA19961; Wed, 15 Dec 1999 11:32:27 -0500 (EST) Message-Id: <199912151632.LAA19961@smtp3.fas.harvard.edu> From: "Russ Cox" Subject: Re: rc futures Date: Wed, 15 Dec 1999 11:32:27 -0500 To: rc@hawkwind.utcs.toronto.edu MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit > 23. Dynamically load readline only when rc is about to read from a > terminal device. This would mean that a single rc binary would be > lean and fast for scripts, but still do readline for interactive use. > However, I suspect that the effort involved in making this happen > portably would be considerable. What operating system doesn't demand-load the binaries anyway? If you're not using the readline code, (the large majority of) it won't be resident in memory. And furthermore surely your OS is sharing text pages, so as long as there is one rc binary running on a terminal, you've already got it loaded and there's no penalty for running more or for running scripts. As Byron said, the mind boggles. Russ From rc-owner Sun Dec 19 02:37:30 1999 Received: from nike.ins.cwru.edu ([129.22.8.219]) by hawkwind.utcs.utoronto.ca with SMTP id <25024>; Sun, 19 Dec 1999 02:25:17 -0500 Received: (chet@localhost) by nike.ins.cwru.edu (8.9.3/CWRU-2.5-bsdi) id LAA15758; Thu, 16 Dec 1999 11:46:11 -0500 (EST) (from chet) Date: Thu, 16 Dec 1999 11:40:55 -0500 From: Chet Ramey To: byron@rakitzis.com Subject: Re: rc futures Cc: rc@hawkwind.utcs.toronto.edu, tjg@star.le.ac.uk, chet@po.cwru.edu Reply-To: chet@po.CWRU.Edu Message-ID: <991216164055.AA15747.SM@nike.ins.cwru.edu> Read-Receipt-To: chet@po.CWRU.Edu MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-In-Reply-To: Message from byron@rakitzis.com of Tue, 14 Dec 1999 04:44:19 -0500 (id <199912140944.BAA04801@peanut.rakitzis.com>) > > 23. Dynamically load readline only when rc is about to read from a > > terminal device. This would mean that a single rc binary would be > > lean and fast for scripts, but still do readline for interactive use. > > However, I suspect that the effort involved in making this happen > > portably would be considerable. > > I don't even know what to say about this. The mind boggles. The idea that > the readline library is so cumbersome that it needs to be dynamically > loaded really weirds me out. Is it that huge now? Processors have improved > by a couple orders of magnitude since I wrote rc! What if a talented > programmer spent a month doing a readline replacement? Could he make > it weigh in at 10% of the size of GNU readline? 5%? 1%? It's not *that* cumbersome. What about dynamic linking and shared libraries? Maybe I'm missing something here, but wouldn't simply linking rc against an already-installed readline library, if one exists, result in 90% of the benefits of rolling your own dynamic linking stuff without the pain? Bash has code in configure (and an option to select it) to figure out whether or not to link against a system version of libreadline rather than the version that comes in the bash distribution. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ( ``Discere est Dolere'' -- chet) Chet Ramey, CWRU chet@po.CWRU.Edu http://cnswww.cns.cwru.edu/~chet/ From rc-owner Sun Dec 19 02:38:38 1999 Received: from front1m.grolier.fr ([195.36.216.51]) by hawkwind.utcs.utoronto.ca with SMTP id <25040>; Sun, 19 Dec 1999 02:25:33 -0500 Received: from cyril (ppp-173-247.villette.club-internet.fr [195.36.173.247]) by front1m.grolier.fr (8.9.3/No_Relay+No_Spam_MGC990224) with ESMTP id AAA07924 for ; Fri, 17 Dec 1999 00:08:47 +0100 (MET) Message-Id: <4.2.2.19991217000504.00a4adc0@mail.vons.local> X-Sender: vons@mail.vons.local (Unverified) X-Mailer: QUALCOMM Windows Eudora Pro Version 4.2.2 Date: Thu, 16 Dec 1999 18:08:24 -0500 To: rc@hawkwind.utcs.toronto.edu From: Gert-Jan Vons Subject: Vrl Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Given the recent discussion about dynamically loading the GNU readline library, I'd like to point out that the latest version of vrl can now be found at http://vons.free.fr . Hope this readline replacement is light enough :-) Regards, Gert-Jan From rc-owner Sun Dec 19 02:45:26 1999 Received: from pantransit.reptiles.org ([209.157.133.146]) by hawkwind.utcs.utoronto.ca with SMTP id <24961>; Sun, 19 Dec 1999 02:25:08 -0500 Received: (qmail 10638 invoked by uid 204); 16 Dec 1999 12:43:13 -0000 Date: Thu, 16 Dec 1999 07:43:13 -0500 Message-ID: <19991216124313.10637.qmail@pantransit.reptiles.org> From: "Smarasderagd" To: rc@hawkwind.utcs.toronto.edu, tjg@star.le.ac.uk Subject: Re: rc futures Tim Goodwin writes: >4. `shift' only works on `$*'. This could be fixed, but it's not hard to >write a function that can shift any variable (except one). Suggested >fix is to the documentation: include the `anyshift' function, and remove >this "bug". >7. `$^var' to join with an arbitrary separating character. Again, this >is easy to fake with a function when needed. I prefer the latter option for both of these, given the simplicity of the workarounds and the lapse of time since the last argument about it. >10. `$PATH' versus `$path'. I think rc should prefer `$path' if both >are set. Likewise for `$cdpath' and `$home'. Ditto previous objections. Any sh/perl/etc. script that thinks it only needs to update PATH/HOME and happens to run an rc script would break. >11. `.' should search `$path'. This will be fixed. I'd be reluctant to possibly break scripts that assume that they can source a file from the current directory even if "." isn't in $path. >12. Extra parentheses around `~' and `!' are syntax errors (you'll >have to get rc-1.6b2 to see what this is about). I suspect that these >"surprising" special cases can be fixed with minor tweaks to the >grammar. (Suggestion due to Bengt Kleberg.) I agree with Byron; the current behaviour is the correct consequence of the syntax, not a bug. >13. Add the `flag' builtin as described in this document. (I've >considered a few "improved" versions of this, but I think the original >specification is pretty much spot on.) > > http://www.star.le.ac.uk/~tjg/rc/misc/td.html Since, with the possible exception of -x, there aren't any flags you'd want to turn on and off during the execution of a script, I don't know if there's any point to this. >14. Add a command line flag that means "don't export any variables". >(Any suggestions for a mnemonic letter?) This is fairly useless on >the command line, but in conjunction with `flag' solves bug 6 neatly. >(Actually, the flag will probably mean "don't export any variables, >except those set in temporary assignments", which is rather more >useful.) I once ran into a problem with a slide-show script which blew up because the shell variable holding the list of images to display took the environment past Linux's size limit for execve() and friends. I fixed the problem pretty simply, and haven't run into it again, but I can imagine situations where it isn't so easily avoided and the limitation is more frustrating. It's not entirely clear what it means to 'not export' a variable, though. Do we make it available only to the current invocation of the shell, and not to explicit subshells invoked via '@{ ... }', but still provide it to other subshells, such as in pipelines? I think it'd be worse to create a peculiar class of variables with a list of exceptions which make sense only if you know about the implementation. >15. Fake bidirectional pipes on systems where `pipe()' produces a >unidirectional pipe, but `socketpair()' exists. (Suggestion due to >Charles Forsyth, via John Murdie.) I'm not sure how useful this is, given that many utilities and the C/C++ library generally make sweeping assumptions that break badly when you try to make them interact through anything other than a (pseudo-)tty. The only application I can think of offhand is testing network software. I'd favour providing some helper program(s) for setting up bidirectionally connected programs and/or pipelines. >17. Improved error reporting, as discussed on the list recently. Also, >I intend that rc should prefix its errors with `rc: '; the long standing >Unix tradition that shells are special in this regard is not very >useful, I think. I tend to think prefixing errors with 'rc:' in interactive sessions is ugly, though it might have saved me some confusion in the past (I was trying to run "host" on a system where it wasn't installed, and began to think that DNS was down because I got "host not found" on every query...) >18. Support BSD editline, and clean up the readline, editline, vrl, etc. >interface if possible. (Suggestion due to Raymond Venneker.) As a 9term user, I mostly want to thrash out the old 'history' utility so that it compiles reliabily with optimization and doesn't sometimes skip lines with a lot of hyphens in them. >22. Add a `sigeof' function, which is invoked when rc sees EOF on >standard input when it's a terminal device. If sigeof returns 1, rc >attempts to continue reading from standard input. > > fn sigeof { echo 'Type `exit'' to leave the shell' >[1=2]; return 1 } > >(Suggestion due to Mark K Gardner.) I desired this briefly when I wanted to prevent accidentally logging out my console window, but I found that while () {. -i /dev/tty; echo NO NO NO NO} did the job for me. You can insert the continue-or-exit logic of your choice in place of the "NO" bit. >28. That's all for now, folks! From rc-owner Tue Dec 21 19:01:20 1999 Received: from whitecrow.demon.co.uk ([194.222.126.246]) by hawkwind.utcs.utoronto.ca with SMTP id <24783>; Tue, 21 Dec 1999 18:39:23 -0500 Received: from whitecrow.demon.co.uk (steve@localhost [127.0.0.1]) by whitecrow.demon.co.uk (8.8.7/8.8.7) with ESMTP id LAA30430 for ; Sun, 19 Dec 1999 11:06:54 GMT Message-Id: <199912191106.LAA30430@whitecrow.demon.co.uk> X-Mailer: exmh version 2.0zeta 7/24/97 To: rc@hawkwind.utcs.toronto.edu Subject: Re: rc futures In-reply-to: Your message of "Thu, 16 Dec 1999 12:43:13 GMT." <19991216124313.10637.qmail@pantransit.reptiles.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 19 Dec 1999 06:06:54 -0500 From: Steve Kilbane When Tim mentioned "rc 2", I have to admit I was expecting something along the lines of "same functionality, 'better' internals". The amount and size of some of the changes being discussed is scary. ( different syntax, different variable handling, different execution semantics, and different input behaviour, and bigger, but otherwise business as usual ). And as Paul/Byron said, if you want some of this, go use es. The only one that makes sense to me is the error messages. I'd favour "rc:" on the command line, and "script-name:" for scripts. If you were going to always include "rc:", I'd want a space after it, so that it didn't confuse wily with "rc:script:nn". I'm not familiar with readline and its variants, having never explicitly gone out looking for it. Does it provide anything other than history recall and editing? If not, $history is enough to provide 99% of that functionality via an external program. steve From rc-owner Sat Dec 25 20:17:29 1999 Received: from tigger.nu.org ([61.8.19.222]) by hawkwind.utcs.utoronto.ca with SMTP id <24766>; Sat, 25 Dec 1999 18:39:17 -0500 Received: by tigger.nu.org (Postfix, from userid 1000) id 4BB21280; Wed, 22 Dec 1999 11:00:26 +1100 (EST) Date: Tue, 21 Dec 1999 19:00:26 -0500 From: Christopher Vance To: Steve Kilbane Cc: rc@hawkwind.utcs.toronto.edu Subject: Re: rc futures Message-ID: <19991222110026.C1449@nu.org> References: <19991216124313.10637.qmail@pantransit.reptiles.org> <199912191106.LAA30430@whitecrow.demon.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0pre3i In-Reply-To: <199912191106.LAA30430@whitecrow.demon.co.uk> On Sun, Dec 19, 1999 at 06:06:54AM -0500, Steve Kilbane wrote: : I'm not familiar with readline and its variants, having never explicitly : gone out looking for it. Does it provide anything other than history : recall and editing? If not, $history is enough to provide 99% of that : functionality via an external program. I've always compiled rc with editline - it's much smaller than readline. I do use recall and editting frequently. The only hassle I've had is that interposing editline has occasionally tripped up the trip tests, and I've had to convince myself that rc was still okay... -- Christopher Vance From rc-owner Wed Jan 5 19:00:02 2000 Received: from fw.softwell.se ([193.15.236.45]) by hawkwind.utcs.utoronto.ca with SMTP id <25189>; Wed, 5 Jan 2000 18:50:34 -0500 Received: from trillian.softwell.se (IDENT:bengt@trillian.softwell.se [192.42.172.11]) by fw.softwell.se (8.9.3/8.9.3) with ESMTP id QAA21309 for ; Mon, 3 Jan 2000 16:44:36 +0100 Received: (from bengt@localhost) by trillian.softwell.se (8.8.7/8.8.7) id QAA28543 for rc@hawkwind.utcs.toronto.edu; Mon, 3 Jan 2000 16:44:36 +0100 From: Bengt Kleberg Message-Id: <200001031544.QAA28543@trillian.softwell.se> To: rc@hawkwind.utcs.toronto.edu Subject: Re: rc futures Date: Mon, 3 Jan 2000 10:46:06 -0500 Greetings, After a (too long) delay I offer my comments to the rc-2.0 wish-list. Points where I have no comment are just left out. > 2. Compile-time limit on `;' separated commands in a line. Good idea, it would be nice to remove built-in limits, and just leave te hard ones (RAM/swap space). > 4. `shift' only works on `$*'. Yes, please add this to the documentation. I needed it a few days ago (last millenium :-), and could not invent it. > 8 & 9, 12. Strange handling of parentheses. Since my misunderstanding of while () {} probably started this thread I would like to add that I now understand that syntax errors from while (()) {} is a feature and not a bug. However, it is confusing and should merit a comment in the documentation of while/if/for > 10. `$PATH' versus `$path'. Please let $path inherit from $PATH, and also assigments to $path be reflected back to $PATH. I would much prefer to think of them as always having the same value. > 11. `.' should search `$path'. Actually, I do not think so. I think it should not. > 16. Make `*' match files beginning with `.' Please do not. > 17. Improved error reporting Yes. A error report like script-name:line-number 'error' would be very useful. > 19. Discard autoconf and automake. Yes please. If this is 'a waste of time' for skilled programmers, consider using my time (it can be wasted upon such activities :-) > 20. ~ expansion. If absolutly neccessary, please make it a compile time option. > 21. Add a command line flag that turns off free carets. If I remember correctly this is a compile time option already. That is surely enough. > 23. Dynamically load readline only when rc Please do not. How about suggesting 2 rc shells in the documentation instead? One for scripts, and one for interactive use. The latter with readline, the former without. > 25. Gert-Jan Vons complains that using `=' in a command's arguments It is ok as it is. I have gotten used to it. > 26. Better testing. Very good idea. Any thing in particular you want a test for? > 27. Smaller, faster, cheaper. Make this #1. And finally, for my personal enjoyment: How about re-introducing if not {} as an alternative to } else { } I have 1 need for this, and I really think it would be nice to have both possiblities. Best Wishes, Bengt =============================================================== Everything aforementioned should be regarded as totally private opinions, and nothing else. bengt@softwell.se ``His great strength is that he is uncompromising. It would make him physically ill to think of programming in C++.'' From rc-owner Wed Jan 5 19:00:09 2000 Received: from apollo.le.ac.uk ([143.210.16.125]) by hawkwind.utcs.utoronto.ca with SMTP id <25294>; Wed, 5 Jan 2000 18:52:01 -0500 Received: from happy.star.le.ac.uk ([143.210.36.58]) by apollo.le.ac.uk with smtp (Exim 3.03 #1) id 125p4V-0001Gl-00 for rc@hawkwind.utcs.toronto.edu; Wed, 05 Jan 2000 11:57:47 +0000 Received: (qmail 1733 invoked from network); 5 Jan 2000 11:58:09 -0000 Received: from ltpcg.star.le.ac.uk (tjg@143.210.36.203) by happy.star.le.ac.uk with SMTP; 5 Jan 2000 11:58:09 -0000 In-Reply-To: <199912151632.LAA19961@smtp3.fas.harvard.edu> To: rc@hawkwind.utcs.toronto.edu Subject: Dynamically loading readline on demand (was Re: rc futures) From: Tim Goodwin Message-ID: Date: Wed, 5 Jan 2000 06:59:36 -0500 > > 23. Dynamically load readline only when rc is about to read from a > > terminal device. > What operating system doesn't demand-load the binaries anyway? > If you're not using the readline code, (the large majority of) it won't > be resident in memory. Sure, but it still slows down fork(). My guess is that this is because of the extra page table entries to be managed. I swear I'm not making this up, and I have data to prove it. But first, let's examine the status quo. Specifying `--with-readline' to the rc configure script ends up simply appending `-lreadline' to the link command line (and maybe `-ltermcap' or similar). This will link rc against readline either dynamically, if the linker finds a libreadline.so, or statically, if the linker only finds libreadline.a or you said `-static' or similar. The INSTALL documentation has this advice to offer. It is a good idea to specify static linking (unless you are linking against a dynamic readline library)---if you are using gcc, you can do this by setting `CFLAGS=-static'. My assumption when I wrote this was that readline is big enough that it's always worth linking against it dynamically if you can. That was a clear violation of the rule: "profile, don't speculate!", so now let me make amends... I took an rc script that does nothing (makes no system calls) except fork() and wait() 10000 times. Dividing the total CPU time to run the script by 10000 gives an average loop time. There are two variables of interest: static versus dynamic linking, and no-readline versus readline; giving four variants of rc to try. (Remember that rc always needs the C library.) Here are the results I got on my 200MHz Linux PC (us = microseconds). rc.static 744us rc.rl.static 865us rc.dynamic 1071us rc.rl.dynamic 1442us (The raw data, together with file sizes, are appended. Lest you think that this is a quirk of Linux, I have even more dramatic results from SunOS 5. Why does dynamic linking increase the user time? I have no idea, but it reliably does on both these platforms.) My conclusion from this is that using readline is an insignificant (although measurable) performance hit. But dynamic linking is always a bad idea. I therefore intend to drop my suggestion that rc should itself load readline on demand, and instead to make the following minor changes for rc-1.6b3. 1. Modify the INSTALL documentation; we should always recommend linking statically. 2. Modify configure.in, so that, if we are using gcc, `-static' is specified. Any comments? Tim. text data bss dec hex filename 347773 13204 16008 376985 5c099 rc.static 12.58user 61.78system 1:14.52elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (100040major+2150702minor)pagefaults 0swaps text data bss dec hex filename 427989 25748 19500 473237 73895 rc.rl.static 13.07user 73.42system 1:26.66elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (200044major+2281366minor)pagefaults 0swaps text data bss dec hex filename 65580 8492 11360 85432 14db8 rc.dynamic 21.16user 85.95system 1:47.22elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (200100major+2449872minor)pagefaults 0swaps text data bss dec hex filename 67213 8532 11552 87297 15501 rc.rl.dynamic 30.07user 114.15system 2:24.65elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (200117major+2827443minor)pagefaults 0swaps From rc-owner Wed Jan 5 19:00:15 2000 Received: from apollo.le.ac.uk ([143.210.16.125]) by hawkwind.utcs.utoronto.ca with SMTP id <25221>; Wed, 5 Jan 2000 18:51:53 -0500 Received: from happy.star.le.ac.uk ([143.210.36.58]) by apollo.le.ac.uk with smtp (Exim 3.03 #1) id 125X1R-0003DY-00 for rc@hawkwind.utcs.toronto.edu; Tue, 04 Jan 2000 16:41:25 +0000 Received: (qmail 21521 invoked from network); 4 Jan 2000 16:42:07 -0000 Received: from ltpcg.star.le.ac.uk (tjg@143.210.36.203) by happy.star.le.ac.uk with SMTP; 4 Jan 2000 16:42:07 -0000 To: rc@hawkwind.utcs.toronto.edu In-Reply-To: Subject: Re: rc futures From: Tim Goodwin Message-ID: Date: Tue, 4 Jan 2000 11:43:12 -0500 First of all, Happy New Year to you all! Thanks to everybody who replied to my message about possible future directions for rc: it's been great to see the discussion. I've taken Paul Haahr's message as a starting point to say more on some points... To try to stop the discussion spiralling off into ever longer messages, I'll initiate separate threads for some of the more controversial items. > Is there really a need for an rc-2? After all, what appeals to me most > about the shell is its perfect minimalism -- adding any new features to > rc could easily make it worse, not better. I agree. I certainly don't intend to tarnish rc's minimalism. I should have stressed this more in my first message: the aim is to round off (a very few) rough corners, without adding lots of new features or extra code. To look at it another way, I think rc's most important aspect is that it is *simple*. (One reason I use rc is that I know that I know its quoting rules. I *think* that I know the sh quoting rules, but that's not quite the same thing...) Simplicity exists at a number of levels, and in most cases there is little conflict between "simple for the implementor", "simple for the installer", and "simple for the user". There are a few places, though, where I think I can make rc even simpler. Finally, I should have made it much clearer in my original message that some of the wackier ideas were just "brain storming", and may never come anywhere near being implemented. > > 1. The ^A bug. This will be fixed. > > How? With es, we use combinations of ^A and ^B, I've considered a number of ideas, and had settled on using ^A and ^B (independently: I didn't know that this was how es solved the problem). I will look at es, and ensure that the rc fix is compatible. > but it's at least as > gross a hack as not allowing ^A. I disagree here. I don't see anything gross about using a transparent encoding. The ^A bug makes the world "not simple" for the user: you have a perfectly good tool, except that it happens to fall apart for certain cases. It's almost as bad as "sed: line too long". Do you want people to use Perl? :-) > > 8 & 9. Strange handling of parentheses. I think this can be fixed with > > some tweaks to the grammar, and probably is worth it. > > > > 12. Extra parentheses around `~' and `!' are syntax errors (you'll > > I don't understand the complaints here. My point 12 was bogus, I was rushing. Ignore it. Point 8 is that you can say this: fn foo { (x.y) = foo; echo $(x.y) } and `foo' works fine in the current shell, but not in descendant shells. Again, I think this is a clear case of "not simple" for the user: either the parent shell should reject the function definition, or it should work in child shells. Now, it might turn out that fixing this turns out to be really hard, in which case I won't bother. It's not that big a deal. But I have a sneaking feeling that this is one of my favourite sort of bugs, where the bug fix actually makes the code simpler. > I think there was a good reason for preferring $PATH: rc invokes a > sh(1) script which sets $path and then invokes and rc script. Changing > this behavior would be a mistake. A number of people have made the same point. I agree. However, given this, I claim that $path and friends should not be exported by rc, nor (ever) interpreted by descendant rc processes. > > 11. `.' should search `$path'. This will be fixed. > > Why? Every other shell does, including (I'm told) the Plan 9 rc. > > 13. Add the `flag' builtin ... > > Why? I can think of occasions where `flag x +' or `flag e +' would be marginally useful. The main reason is to make point 14 work, though. > > 14. Add a command line flag that means "don't export any variables". > > First, the semantics of this are hardly clear. What happens when you > modify a variable which is already in the environment? > > Second, why bother? What need is there for this? Well, ever since I've been involved with rc the man page has listed it as a bug, and there's been discussion on the list about it before. Personally, I have no war stories, and you're right that it would add a fair dose of complexity. Any other opinions? Does anyone have a real need for this? > > 15. Fake bidirectional pipes on systems where `pipe()' produces a > > Why bother? How many times do you find programs that can communicate > with the previous member of a pipeline by writing to their standard > input? It's utterly trivial to do, and there are apparently some Plan 9 scripts that use it. > > 16. Make `*' match files beginning with `.' (except `.' and `..', of A number of people have expressed strong opinions on this one. In both directions, of course :-). I think the status quo prevails. > > 17. Improved error reporting, > > Adding the name of the script seems useful for errors reported from > scripts. There seems to be general agreement on this point. > Adding a ``rc:'' prefix seems a mistake to me. Can you learn to live with it? In my job, I reach for strace, truss, or ktrace *every single day*. At least 50% of the time it's to find out information about an error situation which the application knew, but decided not to bother reporting---and yes, sometimes, it's as fundamental as not even knowing which application encountered an error. Stealing Smarasderagd's example, I know which of these I'd rather see. ; host microsoft.com host not found ; host microsoft.com rc: `host' not found Maybe you think those 6 extra characters are ugly. But they also make it blindingly obvious what went wrong. Alternatively, we could discard the notion that error messages are supposed to help people, and just report every error with "?", or maybe "A device attached to the system is not functioning". :-) > > 19. Discard autoconf and automake. This deserves a separate thread. > > 20. ~ expansion. > > If you want to start a holy war, be my guest. :-) Actually, I'm not a huge fan of ~ expansion, probably because I've never never used a shell that supported it. People seem to like it, but I think it's far too unwieldy to add to rc. It's at least possible that I will some day write the utility getpwnam(1). With this, you could define ; fn h { getpwnam $1 | cut -d: -f6 } and then say ; ls `{h fred} But I don't suppose those arguing for ~ expansion in the shell think much of this idea... > If you want to start a holy war, be my guest. I use ~-expansion, so I'm > hardly one to complain about it. > > 21. Add a command line flag that turns off free carets. > > This seems like a really, really bad idea to me. You're right. It was a lousy idea. > > 23. Dynamically load readline only when rc is about to read from a > > terminal device. > > Ugh. Yes, ugh, but... (Separate thread for this one, too.) Tim. From rc-owner Wed Jan 12 16:17:19 2000 Received: from adsl-216-102-199-169.dsl.snfc21.pacbell.net ([216.102.199.169]) by hawkwind.utcs.utoronto.ca with SMTP id <25526>; Wed, 12 Jan 2000 16:14:45 -0500 Received: (from haahr@localhost) by adsl-216-102-199-169.dsl.snfc21.pacbell.net (8.8.7/8.8.7) id PAA05305; Sat, 8 Jan 2000 15:26:05 -0800 X-Authentication-Warning: iadd.jivetech.com: haahr set sender to haahr@jivetech.com using -f From: Paul Haahr X-Attribution: haahr Message-Id: Date: Fri, 31 Dec 1999 18:26:04 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: Tim Goodwin Cc: rc@hawkwind.utcs.toronto.edu Subject: Re: rc futures In-Reply-To: References: X-Mailer: VM 6.30 under Emacs 20.3.1 Tim Goodwin wrote, replying to me, replying to him: > > How? With es, we use combinations of ^A and ^B, > > I've considered a number of ideas, and had settled on using ^A and ^B > (independently: I didn't know that this was how es solved the problem). > I will look at es, and ensure that the rc fix is compatible. Great. > > but it's at least as > > gross a hack as not allowing ^A. > > I disagree here. I don't see anything gross about using a transparent > encoding. The ^A bug makes the world "not simple" for the user: you > have a perfectly good tool, except that it happens to fall apart for > certain cases. It's almost as bad as "sed: line too long". Do you want > people to use Perl? :-) I guess I've been bitten so rarely by the restriction that it doesn't bother me. Much more troublesome as a practical matter, IMNHO, is the restriction about not putting \0 in es strings, but that's much more problematic to ``fix.'' > Point 8 is that you can say this: > > fn foo { (x.y) = foo; echo $(x.y) } > > and `foo' works fine in the current shell, but not in descendant shells. > Again, I think this is a clear case of "not simple" for the user: either > the parent shell should reject the function definition, or it should > work in child shells. > > Now, it might turn out that fixing this turns out to be really hard, > in which case I won't bother. It's not that big a deal. But I have a > sneaking feeling that this is one of my favourite sort of bugs, where > the bug fix actually makes the code simpler. I think it's just a bug in footobar.c:Tconv(), where the current code is a little too pessimistic about when to insert parentheses. See the case which handles nCount, nFlat, and nVar. The test which sets lp and rp (using an audacious comma expression) should probably also look at the contents of the string to see if it's got ``interesting'' characters. > > I think there was a good reason for preferring $PATH: rc invokes a > > sh(1) script which sets $path and then invokes and rc script. Changing > > this behavior would be a mistake. > > A number of people have made the same point. I agree. However, given > this, I claim that $path and friends should not be exported by rc, nor > (ever) interpreted by descendant rc processes. Agreed. Es avoids exporting $path and $home for that reason. > > > 11. `.' should search `$path'. This will be fixed. > > Why? > Every other shell does, including (I'm told) the Plan 9 rc. Interesting. The docs for Plan 9 rc indicate that that's true, going back to the version in the printed 10th edition manuals. As do sh and its descendents, though not the csh family. According to Chet Ramey, Posix mandates path searching for ``.'' in csh. But Byron's rc never has, and I don't think it should. Byron put it better than I could in a note to this list from 1993: From: byron@netapp.com (Byron Rakitzis) To: davidf@golem.waterloo.on.ca Cc: rc@hawkwind.utcs.toronto.edu Subject: Re: rc 1.5 Date: Fri, 16 Apr 1993 18:21:39 -0400 >Will 1.5 be brought into line with the Plan 9 man page? That's a good question. I'm hoping to freeze rc. I also don't feel the need to bring rc "into line" with anything else. So offhand I would say no. The flag command is present in plan9 rc for a very specific reason (/lib/rcmain). And I don't want dot to search my path. What if I do: ; cat >test < > > 13. Add the `flag' builtin ... > > Why? > [...] The main reason is to make point 14 work, though. > > > > 14. Add a command line flag that means "don't export any variables". > > [...] > > Well, ever since I've been involved with rc the man page has listed > it as a bug, and there's been discussion on the list about it before. > Personally, I have no war stories, and you're right that it would add a > fair dose of complexity. > > Any other opinions? Does anyone have a real need for this? I would strongly suggest you leave this on the back burner (and perhaps remove the comment from the man page) until it becomes a pressing issue for real applications. > > > 15. Fake bidirectional pipes on systems where `pipe()' produces a > > > > Why bother? How many times do you find programs that can communicate > > with the previous member of a pipeline by writing to their standard > > input? > > It's utterly trivial to do, and there are apparently some Plan 9 > scripts that use it. Except that it adds at least one more #ifdef option, which is a much higher configuration and complexity increase than the utility of the feature merits. (I've come to believe that conditional compilation options are almost always wrong.) > > Adding a ``rc:'' prefix seems a mistake to me. > > Can you learn to live with it? (Me? I don't actually use rc anymore. As much as I use a shell, I use es, but I probably use complex shell commands once a day at most. But I continue to think of rc as one of the most nearly perfect programs I see, so my advice about it will always be radically conservative.) > In my job, I reach for strace, truss, or ktrace *every single day*. > At least 50% of the time it's to find out information about an error > situation which the application knew, but decided not to bother > reporting---and yes, sometimes, it's as fundamental as not even > knowing which application encountered an error. > > Stealing Smarasderagd's example, I know which of these I'd rather see. > > ; host microsoft.com > host not found > > ; host microsoft.com > rc: `host' not found > > Maybe you think those 6 extra characters are ugly. But they also make > it blindingly obvious what went wrong. I guess I work on enough different problems from you that this hasn't hit me. The quotes do help in the error message, I think, and are vastly preferable to the ``:'' sh and es use. The rc prefix doesn't add anything, but that's just my opinion. (I guess I don't want the shell to be drawing attention to itself.) Much more useful, I think, as an addition to error messages would be printing the program which actually died with a signal in a pipeline. For example, in: ; ls | sleep 1000 | wc 0 0 0 illegal instruction ; it could have been helpful to know that it was sleep that got killed. --p From rc-owner Wed Jan 12 16:17:35 2000 Received: from adsl-216-102-199-169.dsl.snfc21.pacbell.net ([216.102.199.169]) by hawkwind.utcs.utoronto.ca with SMTP id <25527>; Wed, 12 Jan 2000 16:14:53 -0500 Received: (from haahr@localhost) by adsl-216-102-199-169.dsl.snfc21.pacbell.net (8.8.7/8.8.7) id QAA07822; Sat, 8 Jan 2000 16:22:08 -0800 X-Authentication-Warning: iadd.jivetech.com: haahr set sender to haahr@jivetech.com using -f From: Paul Haahr X-Attribution: haahr Message-Id: Date: Fri, 31 Dec 1999 19:22:08 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: Tim Goodwin Cc: rc@hawkwind.utcs.toronto.edu Subject: Re: Dynamically loading readline on demand (was Re: rc futures) In-Reply-To: References: <199912151632.LAA19961@smtp3.fas.harvard.edu> X-Mailer: VM 6.30 under Emacs 20.3.1 Tim Goodwin wrote > I took an rc script that does nothing (makes no system calls) except > fork() and wait() 10000 times. Are you sure it doesn't exec at all? Most of the costs associated with dynamic loading would correspond with execs. My comments below work on the assumption that an exec of rc is included in your timing tests. If it wasn't, I'd be curious to see your script. > Here are the results I got on my 200MHz Linux PC (us = microseconds). > > rc.static 744us > rc.rl.static 865us > rc.dynamic 1071us > rc.rl.dynamic 1442us I guess it depends on what your test measures. A ~30% performance penaly doesn't seem like that much if it's saving enough by sharing the library with other clients. > ([...] Why does dynamic linking increase the user time? I have no > idea, but it reliably does on both these platforms.) (If you really care, see John Levine's excellent _Linkers and Loaders_ book, especially chapters 9 and 10. Available at http://www.amazon.com/exec/obidos/ASIN/1558604960/paulhaahrA and finer tech bookstores. The short answer is ``because dynamic linking is done with user-space code.'') > My conclusion from this is that using readline is an insignificant > (although measurable) performance hit. But dynamic linking is always > a bad idea. No. Dynamic linking slows startup time down with the gain of using less memory overall. It also makes systems more flexible, allowing the upgrade of library code without explicit relinking of applications, which is a big win. > I therefore intend to drop my suggestion that rc should itself load > readline on demand, and instead to make the following minor changes > for rc-1.6b3. > > 1. Modify the INSTALL documentation; we should always recommend linking > statically. > > 2. Modify configure.in, so that, if we are using gcc, `-static' is > specified. I disagree. Overall system resource consumption still goes down with dynamic linking and loading. If a system is set up to use dynamic linking by default, why should rc override that? A number of us argued squarely against dynamic linking in the early '90s, at least partially because dynamic linking encouraged software bloat. The bloatists won because techniques like dynamic linking (along with Moore's law) made the costs of bloat minimal. (And, when it comes down to it, bloat in libraries is probably a good thing.) --p From rc-owner Wed Jan 12 16:17:42 2000 Received: from mail.rdc1.ct.home.com ([24.2.0.66]) by hawkwind.utcs.utoronto.ca with SMTP id <25466>; Wed, 12 Jan 2000 16:13:48 -0500 Received: from dillinja.dhs.org ([24.2.177.105]) by mail.rdc1.ct.home.com (InterMail v4.01.01.07 201-229-111-110) with SMTP id <20000107034508.IUNY9446.mail.rdc1.ct.home.com@dillinja.dhs.org> for ; Thu, 6 Jan 2000 19:45:08 -0800 Received: by dillinja.dhs.org (sSMTP sendmail emulation); Thu, 6 Jan 2000 22:46:09 +4300 From: Decklin Foster To: rc@hawkwind.utcs.toronto.edu Subject: Re: rc futures Message-ID: <20000106224609.B19379@dillinja> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Mutt/1.0i In-Reply-To: ; from tjg@star.le.ac.uk on Fri, Dec 10, 1999 at 11:55:06AM -0500 Date: Thu, 6 Jan 2000 22:45:41 -0500 [boy, I'm late replying to this. *don't* ask where i've been...] Tim Goodwin writes: > 5. Builtin `echo'. Well, it's not going away :-). There's always the > compile-time option to omit it... We could always make echo an optionally-compile-inable builtin /a la/ the stuff in addon.c, and make the people who want it figure out how to have it be linked in... ;-) Not that *hard*, just annoying. > 6. Avoid exporting a variable: see below. Why do we need this? My apologies if this has already been gone over. I always thought it was some bizzare sh-ism that I was destined never to understand... > 10. `$PATH' versus `$path'. I think rc should prefer `$path' if both > are set. Likewise for `$cdpath' and `$home'. Ooops. I thought, from reading the manpage, that rc updated $PATH if something set $path and vice versa? I guess this must not be the case. > 11. `.' should search `$path'. This will be fixed. Well, we've had some debate here (and i'm definetly on the `against' side.) My request is this: bash allows 'source' as a synonym for '.'. I can make a 'source' function for interactive use, but interactively I'd just type '.' anyway (it's shorter after all). I just prefer 'source' in shell scripts because it's vastly more readable IMHO. especially when sourcing a dotfile. And scripts can't pull this hypothetical function out of my $home/.rcrc, unless i'm mistaken. > 17. Improved error reporting, as discussed on the list recently. Also, > I intend that rc should prefix its errors with `rc: '; the long standing > Unix tradition that shells are special in this regard is not very > useful, I think. Great. However, I went to go try to add this and discovered print.c. I must admit that i'm entirely lost in it. It *seems* to be a copy of fprintf. Are we actually trying to be portable to systems without a printf? :-) But seriously, there are some entry points which deal with this Format structure that i'm not sure of the significance of... So can anyone lend a hand? I'd really like to grok this code. If you only reply to one issue in this mail, make it this one. > 18. Support BSD editline, and clean up the readline, editline, vrl, etc. > interface if possible. (Suggestion due to Raymond Venneker.) also a more (intellegent, bloated, take your pick... ;-)) readline interface. with bash readline can look inside variables and complete against $PATH if it's the first word, and so on... If I can figure out how to help with #17 and it gets fixed then I'll take a look at this. Don't worry, i'll ask if I have to add anything *really* fattening. > 19. Discard autoconf and automake. I wrote a long message to the > <9fans> list about some of my objections to autoconf. I have a > replacement system in the wings. That'd be nice. One thing I would like is for all code which implements fixes for low-level stuff that's broken/nonexistent on certain systems be placed in a separate directory (say lib/). Then write everything else (i.e. the important rc code) to a sane interface, and bring in the code that wraps the unsane interfaces inside sane interfaces in as needed. > 20. ~ expansion. I am, of course, biased for this, if only because I haven't actually used ~ for matching in a script yet... Here's my question. Is there really anything about '~' (the builtin) that can't be done with an external program? Why does it get a special glyph indtead of a name like 'match'? I never use '[' for 'test' when i'm using rc... Obviously, you can argue that there's nothing at all essential about using ~ to denote $home, but you have to make a tradeoff somwhere. > 27. Smaller, faster, cheaper. I don't think rc has any major > inefficiencies, but I will certainly throw some profiling tools at > it, to see if there are improvements to be made. In this context, > "cheaper" means smaller to download, or faster to build. Don't forget easier to read (as in source code) -- for those of us struggling to learn. -- Written with 100% free software. Please support the following websites: www.noamazon.com www.eviltoy.com www.debian.org www.gnu.org lpf.ai.mit.edu From rc-owner Wed Jan 12 16:17:49 2000 Received: from fw.softwell.se ([193.15.236.45]) by hawkwind.utcs.utoronto.ca with SMTP id <25027>; Wed, 12 Jan 2000 16:15:01 -0500 Received: from trillian.softwell.se (IDENT:bengt@trillian.softwell.se [192.42.172.11]) by fw.softwell.se (8.9.3/8.9.3) with ESMTP id PAA06623 for ; Wed, 12 Jan 2000 15:20:55 +0100 Received: (from bengt@localhost) by trillian.softwell.se (8.8.7/8.8.7) id PAA32127 for rc@hawkwind.utcs.toronto.edu; Wed, 12 Jan 2000 15:20:55 +0100 From: Bengt Kleberg Message-Id: <200001121420.PAA32127@trillian.softwell.se> To: rc@hawkwind.utcs.toronto.edu Subject: Re: rc futures Date: Wed, 12 Jan 2000 09:22:28 -0500 > From: Tim Goodwin > the aim is to round off (a very few) rough corners, without adding lots of new features or extra > code. Good. > Point 8 is that you can say this: > fn foo { (x.y) = foo; echo $(x.y) } > and `foo' works fine in the current shell, but not in descendant shells. IMHO, that is definitly a bug. > I claim that $path and friends should not be exported by rc, nor > (ever) interpreted by descendant rc processes. I interpret this to mean that each rc process sets $path from $PATH upon start-up, and then tracks changes to $path over to $PATH. $PATH is then exported to descendant rc processes. Correct? > `.' should search `$path' ... > [because] every other shell does, including (I'm told) the Plan 9 rc. Iff Plan9 rc does, then ok (grudgingly :-) > 17. Improved error reporting, ...deleted > rc: `host' not found Looks fine to me. > 19. Discard autoconf and automake. > This deserves a separate thread. Please start it. Best Wishes, Bengt =============================================================== Everything aforementioned should be regarded as totally private opinions, and nothing else. bengt@softwell.se ``His great strength is that he is uncompromising. It would make him physically ill to think of programming in C++.'' From rc-owner Wed Jan 12 16:17:54 2000 Received: from fw.softwell.se ([193.15.236.45]) by hawkwind.utcs.utoronto.ca with SMTP id <25470>; Wed, 12 Jan 2000 16:14:37 -0500 Received: from trillian.softwell.se (IDENT:bengt@trillian.softwell.se [192.42.172.11]) by fw.softwell.se (8.9.3/8.9.3) with ESMTP id LAA28864; Fri, 7 Jan 2000 11:37:06 +0100 Received: (from bengt@localhost) by trillian.softwell.se (8.8.7/8.8.7) id LAA14045; Fri, 7 Jan 2000 11:37:05 +0100 From: Bengt Kleberg Message-Id: <200001071037.LAA14045@trillian.softwell.se> To: rc@hawkwind.utcs.toronto.edu, tjg@star.le.ac.uk Subject: Re: Dynamically loading readline on demand (was Re: rc futures) Date: Fri, 7 Jan 2000 05:38:37 -0500 > 1. Modify the INSTALL documentation; we should always recommend linking statically. > 2. Modify configure.in, so that, if we are using gcc, `-static' is specified. Yes. To both. From rc-owner Thu Jan 13 17:35:07 2000 Received: from adsl-216-102-199-169.dsl.snfc21.pacbell.net ([216.102.199.169]) by hawkwind.utcs.utoronto.ca with SMTP id <25080>; Thu, 13 Jan 2000 17:33:42 -0500 Received: (from haahr@localhost) by adsl-216-102-199-169.dsl.snfc21.pacbell.net (8.8.7/8.8.7) id UAA10238; Wed, 12 Jan 2000 20:20:54 -0800 X-Authentication-Warning: iadd.jivetech.com: haahr set sender to haahr@jivetech.com using -f From: Paul Haahr X-Attribution: haahr Message-Id: Date: Fri, 31 Dec 1999 23:20:54 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: Decklin Foster Cc: rc@hawkwind.utcs.toronto.edu Subject: Re: rc futures In-Reply-To: <20000106224609.B19379@dillinja> References: <20000106224609.B19379@dillinja> X-Mailer: VM 6.30 under Emacs 20.3.1 Decklin Foster wrote: > > 5. Builtin `echo'. Well, it's not going away :-). There's always the > > compile-time option to omit it... > > We could always make echo an optionally-compile-inable builtin /a la/ > the stuff in addon.c, and make the people who want it figure out how > to have it be linked in... ;-) Not that *hard*, just annoying. No. Adding compile-time options is always worse. > > 10. `$PATH' versus `$path'. I think rc should prefer `$path' if both > > are set. Likewise for `$cdpath' and `$home'. > > Ooops. I thought, from reading the manpage, that rc updated $PATH if > something set $path and vice versa? I guess this must not be the case. It does the right thing. Play with it for a second to see: ; path = a b b not found ; path = (a b) ; echo $PATH a:b ; PATH=x:y ; echo $path x y ; > > 17. Improved error reporting, as discussed on the list recently. Also, > > I intend that rc should prefix its errors with `rc: '; the long standing > > Unix tradition that shells are special in this regard is not very > > useful, I think. > > Great. However, I went to go try to add this and discovered print.c. Adding it to print.c would be problematic, I think, because there's no distinguished function for printing errors. (I believe es uses eprint for that purpose.) And the important part, source file name and line number, requires understanding the somewhat more subtle stuff going on in input.c. > I must admit that i'm entirely lost in it. It *seems* to be a copy of > fprintf. Are we actually trying to be portable to systems without a > printf? :-) That code is my fault, if I remember properly. Byron and I were taken with the notion of the Plan 9 print() and fmtinstall(), and used that model pervasively. In particular, function exporting depends on the %T conversion rules -- see footobar.c:Tconv(). Other difference with the stdio printf family (aside from letting you install your own formatters), include that it works directly with file descriptors and is unbuffered. As to excesses in the NIH department, I'm pretty sure rc used to ship with its own malloc(), too. (Sun's malloc was very slow at one point.) > But seriously, there are some entry points which deal with this Format > structure that i'm not sure of the significance of... I suspect you're looking at mprint() which returns a string containing the formated output, allocated with malloc(), and nprint(), which does the same with nalloc() allocated memory. > > 18. Support BSD editline, and clean up the readline, editline, vrl, etc. > > interface if possible. (Suggestion due to Raymond Venneker.) > > also a more (intellegent, bloated, take your pick... ;-)) readline > interface. with bash readline can look inside variables and complete > against $PATH if it's the first word, and so on... If I can figure out > how to help with #17 and it gets fixed then I'll take a look at this. > Don't worry, i'll ask if I have to add anything *really* fattening. I thought making getenv do the right thing was most of the battle here. > > 20. ~ expansion. > > I am, of course, biased for this, if only because I haven't actually > used ~ for matching in a script yet... Here's my question. Is there > really anything about '~' (the builtin) that can't be done with an > external program? Why does it get a special glyph indtead of a name > like 'match'? I never use '[' for 'test' when i'm using rc... It got a special character because Tom Duff said it did. But it can't be confined to an external program because it uses the globbing rules, so it needs to distinguish between, say, unquoted * and quoted '*'. > Obviously, you can argue that there's nothing at all essential about > using ~ to denote $home, but you have to make a tradeoff somwhere. It can easily do both. It does in es, and in several rc variants people have hacked up. --p From rc-owner Thu Jan 13 17:35:16 2000 Received: from gw.goop.org ([206.170.148.147]) by hawkwind.utcs.utoronto.ca with SMTP id <25059>; Thu, 13 Jan 2000 17:33:26 -0500 Received: from ixodes.goop.org (ixodes [192.168.0.5]) by gw.goop.org (Postfix) with ESMTP id 0A2B562002; Wed, 12 Jan 2000 16:19:12 -0800 (PST) Received: by ixodes.goop.org (Postfix, from userid 223) id 78A7AACDE6; Wed, 12 Jan 2000 16:19:06 -0800 (PST) Content-Length: 757 Message-ID: X-Mailer: XFMail 1.3 [p0] on Linux X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: From: Jeremy Fitzhardinge To: Tim Goodwin Subject: RE: Dynamically loading readline on demand (was Re: rc futures) Cc: rc@hawkwind.utcs.toronto.edu Date: Wed, 12 Jan 2000 19:19:36 -0500 On 05-Jan-00 Tim Goodwin wrote: > Here are the results I got on my 200MHz Linux PC (us = microseconds). > > rc.static 744us > rc.rl.static 865us > rc.dynamic 1071us > rc.rl.dynamic 1442us > > (The raw data, together with file sizes, are appended. Lest you think > that this is a quirk of Linux, I have even more dramatic results from > SunOS 5. Why does dynamic linking increase the user time? I have no > idea, but it reliably does on both these platforms.) I had noticed the same thing. I tend build two versions of rc: "rci" for interactive use, which contains readline, and plain "rc" which is minimal and statically linked, for scripts. I've never noticed a real-world performance difference between them. J From rc-owner Thu Jan 13 17:35:23 2000 Received: from nike.ins.cwru.edu ([129.22.8.219]) by hawkwind.utcs.utoronto.ca with SMTP id <25027>; Thu, 13 Jan 2000 17:32:06 -0500 Received: (chet@localhost) by nike.ins.cwru.edu (8.9.3/CWRU-2.5-bsdi) id QAA53644; Wed, 12 Jan 2000 16:34:31 -0500 (EST) (from chet) From: Chet Ramey To: haahr@jivetech.com Subject: Re: rc futures Cc: tjg@star.le.ac.uk, rc@hawkwind.utcs.toronto.edu Reply-To: chet@po.CWRU.Edu Message-ID: <1000112213339.AA53639.SM@nike.ins.cwru.edu> Read-Receipt-To: chet@po.CWRU.Edu MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-In-Reply-To: Message from haahr@jivetech.com of Fri, 31 Dec 1999 18:26:04 -0500 (id ) Date: Wed, 12 Jan 2000 16:34:56 -0500 > Interesting. The docs for Plan 9 rc indicate that that's true, going > back to the version in the printed 10th edition manuals. As do sh and > its descendents, though not the csh family. According to Chet Ramey, > Posix mandates path searching for ``.'' in csh. I assume you mean `sh' here. POSIX.2, section 3.14.4. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ( ``Discere est Dolere'' -- chet) Chet Ramey, CWRU chet@po.CWRU.Edu http://cnswww.cns.cwru.edu/~chet/ From rc-owner Thu Jan 13 17:35:31 2000 Received: from adsl-216-102-199-169.dsl.snfc21.pacbell.net ([216.102.199.169]) by hawkwind.utcs.utoronto.ca with SMTP id <25073>; Thu, 13 Jan 2000 17:33:34 -0500 Received: (from haahr@localhost) by adsl-216-102-199-169.dsl.snfc21.pacbell.net (8.8.7/8.8.7) id SAA10190; Wed, 12 Jan 2000 18:55:11 -0800 X-Authentication-Warning: iadd.jivetech.com: haahr set sender to haahr@jivetech.com using -f From: Paul Haahr X-Attribution: haahr Message-Id: Date: Fri, 31 Dec 1999 21:55:11 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: Chet Ramey Cc: rc@hawkwind.utcs.toronto.edu Subject: Re: rc futures In-Reply-To: <1000112213339.AA53639.SM@nike.ins.cwru.edu> References: <1000112213339.AA53639.SM@nike.ins.cwru.edu> X-Mailer: VM 6.30 under Emacs 20.3.1 Chet Ramey wrote, quoting me > > Interesting. The docs for Plan 9 rc indicate that that's true, going > > back to the version in the printed 10th edition manuals. As do sh and > > its descendents, though not the csh family. According to Chet Ramey, > > Posix mandates path searching for ``.'' in csh. > > I assume you mean `sh' here. POSIX.2, section 3.14.4. Yes. Sorry for any confusion. --p From rc-owner Fri Jan 14 17:18:10 2000 Received: from apollo.le.ac.uk ([143.210.16.125]) by hawkwind.utcs.utoronto.ca with SMTP id <25165>; Fri, 14 Jan 2000 15:32:36 -0500 Received: from happy.star.le.ac.uk ([143.210.36.58]) by apollo.le.ac.uk with smtp (Exim 3.03 #1) id 1299Wx-0007PG-00 for rc@hawkwind.utcs.toronto.edu; Fri, 14 Jan 2000 16:24:55 +0000 Received: (qmail 13094 invoked from network); 14 Jan 2000 16:25:29 -0000 Received: from ltpcg.star.le.ac.uk (tjg@143.210.36.203) by happy.star.le.ac.uk with SMTP; 14 Jan 2000 16:25:29 -0000 To: Paul Haahr In-Reply-To: Cc: rc@hawkwind.utcs.toronto.edu Subject: Re: Dynamically loading readline on demand (was Re: rc futures) From: Tim Goodwin Message-ID: Date: Fri, 14 Jan 2000 11:26:20 -0500 > > I took an rc script that does nothing (makes no system calls) except > > fork() and wait() 10000 times. > > Are you sure it doesn't exec at all? You tell me. for (i in 0 1 2 3 4 5 6 7 8 9) ... for (m in 0 1 2 3 4 5 6 7 8 9) @{ ~ 0 0 } According to strace on my Linux box, each loop calls fork(), close(), rt_sigaction() twice, _exit(), and wait(). > > ([...] Why does dynamic linking increase the user time? > The short answer is ``because dynamic > linking is done with user-space code.'') Yeah: in crt0. But (I'm sure) that isn't involved here. I'd expect fork() to take more *system* time (since there are more MAP_SHARED page table entries to fiddle with), but I don't understand the increase in user time. > I disagree. Overall system resource consumption still goes down with > dynamic linking and loading. If a system is set up to use dynamic > linking by default, why should rc override that? You're right. I wish you'd stop doing that :-). Forcing static linking down people's throats is Not Nice. Particularly because (at least with the present setup) it's dead easy to turn static linking on, but it would be quite hard to turn it off. (For comparison, see how easy it isn't to turn off `-Wall' if you're using gcc.) I still intend to advocate it in the INSTALL document, though. Tim. From rc-owner Fri Jan 14 17:18:18 2000 Received: from adsl-216-102-199-169.dsl.snfc21.pacbell.net ([216.102.199.169]) by hawkwind.utcs.utoronto.ca with SMTP id <25175>; Fri, 14 Jan 2000 15:32:44 -0500 Received: (from haahr@localhost) by adsl-216-102-199-169.dsl.snfc21.pacbell.net (8.8.7/8.8.7) id LAA11797; Fri, 14 Jan 2000 11:18:07 -0800 X-Authentication-Warning: iadd.jivetech.com: haahr set sender to haahr@jivetech.com using -f From: Paul Haahr X-Attribution: haahr Message-Id: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: Tim Goodwin Cc: rc@hawkwind.utcs.toronto.edu Subject: Re: Dynamically loading readline on demand (was Re: rc futures) In-Reply-To: References: X-Mailer: VM 6.30 under Emacs 20.3.1 Date: Fri, 14 Jan 2000 14:18:49 -0500 Tim Goodwin wrote, replying to me, replying to him: > > > I took an rc script that does nothing (makes no system calls) except > > > fork() and wait() 10000 times. > > > > Are you sure it doesn't exec at all? > > You tell me. > > for (i in 0 1 2 3 4 5 6 7 8 9) > ... > for (m in 0 1 2 3 4 5 6 7 8 9) > @{ ~ 0 0 } > > According to strace on my Linux box, each loop calls fork(), close(), > rt_sigaction() twice, _exit(), and wait(). Fascinating. My guess was definitely wrong. > > > ([...] Why does dynamic linking increase the user time? > > The short answer is ``because dynamic > > linking is done with user-space code.'') > > Yeah: in crt0. But (I'm sure) that isn't involved here. I'd expect > fork() to take more *system* time (since there are more MAP_SHARED page > table entries to fiddle with), but I don't understand the increase in > user time. The only thing I can guess is that using the PIC version of the code in the shared libraries and the shared library calling sequences is hurting much more than I would have expected. (Chapter 8 of Levine's book goes into the issues here.) My guess would have been at most a 10% hit, not the 30% you're reporting. Detailed profiling might shed more light. --p From rc-owner Fri Jan 14 17:18:25 2000 Received: from fw.softwell.se ([193.15.236.45]) by hawkwind.utcs.utoronto.ca with SMTP id <25162>; Fri, 14 Jan 2000 15:32:20 -0500 Received: from trillian.softwell.se (IDENT:bengt@trillian.softwell.se [192.42.172.11]) by fw.softwell.se (8.9.3/8.9.3) with ESMTP id NAA11413; Fri, 14 Jan 2000 13:15:59 +0100 Received: (from bengt@localhost) by trillian.softwell.se (8.8.7/8.8.7) id NAA01047; Fri, 14 Jan 2000 13:15:59 +0100 From: Bengt Kleberg Message-Id: <200001141215.NAA01047@trillian.softwell.se> To: haahr@jivetech.com, tjg@star.le.ac.uk Subject: Re: rc futures Cc: rc@hawkwind.utcs.toronto.edu Date: Fri, 14 Jan 2000 07:16:34 -0500 > From: Paul Haahr > Posix mandates path searching for ``.'' in sh. > But Byron's rc never has, and I don't think it should. Agree. From rc-owner Fri Jan 14 17:18:53 2000 Received: from fw.softwell.se ([193.15.236.45]) by hawkwind.utcs.utoronto.ca with SMTP id <25158>; Fri, 14 Jan 2000 15:31:45 -0500 Received: from trillian.softwell.se (IDENT:bengt@trillian.softwell.se [192.42.172.11]) by fw.softwell.se (8.9.3/8.9.3) with ESMTP id MAA11253; Fri, 14 Jan 2000 12:09:36 +0100 Received: (from bengt@localhost) by trillian.softwell.se (8.8.7/8.8.7) id MAA30516; Fri, 14 Jan 2000 12:09:36 +0100 From: Bengt Kleberg Message-Id: <200001141109.MAA30516@trillian.softwell.se> To: haahr@jivetech.com, tjg@star.le.ac.uk Subject: Re: Dynamically loading readline on demand (was Re: rc futures) Cc: rc@hawkwind.utcs.toronto.edu Date: Fri, 14 Jan 2000 06:11:05 -0500 > From: Paul Haahr > > Tim Goodwin wrote > > Here are the results I got on my 200MHz Linux PC (us = microseconds). > > rc.static 744us > > rc.rl.static 865us > > rc.dynamic 1071us > > rc.rl.dynamic 1442us > A ~30% performance > penaly doesn't seem like that much if it's saving enough by sharing the > library with other clients. I would disagree here. I start rc scripts from wily all the time. They are really short and my SS2 needs all the help it can get to make things faster. Ofcourse, I do not use readline and run the scripts in sequence, so the memory savings would not be great (or?, what sizes accompany the rc.static, rc.dynamic, xxx) > bloat in libraries is probably a good thing Yes, I agree here. But a shell is special, (my usage of rc is special :-) it is started lots of times, finnishes quickly and is not run many times in parallell. Best Wishes, Bengt =============================================================== Everything aforementioned should be regarded as totally private opinions, and nothing else. bengt@softwell.se ``His great strength is that he is uncompromising. It would make him physically ill to think of programming in C++.'' From rc-owner Fri Jan 14 17:19:00 2000 Received: from fw.softwell.se ([193.15.236.45]) by hawkwind.utcs.utoronto.ca with SMTP id <25163>; Fri, 14 Jan 2000 15:32:28 -0500 Received: from trillian.softwell.se (IDENT:bengt@trillian.softwell.se [192.42.172.11]) by fw.softwell.se (8.9.3/8.9.3) with ESMTP id NAA11422; Fri, 14 Jan 2000 13:19:39 +0100 Received: (from bengt@localhost) by trillian.softwell.se (8.8.7/8.8.7) id NAA01298; Fri, 14 Jan 2000 13:19:39 +0100 From: Bengt Kleberg Message-Id: <200001141219.NAA01298@trillian.softwell.se> To: fosterd@hartwick.edu, haahr@jivetech.com Subject: Re: rc futures Cc: rc@hawkwind.utcs.toronto.edu Date: Fri, 14 Jan 2000 07:20:05 -0500 > From: Paul Haahr > > Decklin Foster wrote: > > 20. ~ expansion. > > I am, of course, biased for this, if only because I haven't actually > > used ~ for matching in a script yet. I use it in 1 out of 2 sripts. All that have -a style arguments. From rc-owner Tue Jan 18 00:05:36 2000 Received: from whitecrow.demon.co.uk ([194.222.126.246]) by hawkwind.utcs.utoronto.ca with SMTP id <25539>; Mon, 17 Jan 2000 23:52:03 -0500 Received: from whitecrow.demon.co.uk (steve@localhost [127.0.0.1]) by whitecrow.demon.co.uk (8.8.7/8.8.7) with ESMTP id UAA23922 for ; Fri, 14 Jan 2000 20:21:40 GMT Message-Id: <200001142021.UAA23922@whitecrow.demon.co.uk> X-Mailer: exmh version 2.0zeta 7/24/97 To: rc@hawkwind.utcs.toronto.edu Subject: Re: rc futures In-reply-to: Your message of "Sat, 01 Jan 2000 04:20:54 GMT." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii From: Steve Kilbane Date: Sat, 15 Jan 2000 03:58:35 -0500 Paul wrote: > Adding it to print.c would be problematic, I think, because there's no > distinguished function for printing errors. No big deal. If there are going to be any changes, then I think there should be a clear distinction, during discussion, between those which affect behaviour, and those which affect implementation. As I think I mentioned earlier, when Tim raised the subject of 2.x, I first took that to mean an internal reorganisation, rather than an external one. steve From rc-owner Mon Apr 17 16:31:05 2000 Received: from newton.hartwick.edu ([147.205.85.10]) by hawkwind.utcs.toronto.edu with SMTP id <25522>; Mon, 17 Apr 2000 16:21:34 -0400 Received: from c26469-a.clnvl1.ct.home.com (147.205.111.20 [147.205.111.20]) by newton.hartwick.edu with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2448.0) id HRZAVXCB; Sat, 15 Apr 2000 23:48:09 -0400 Received: by c26469-a.clnvl1.ct.home.com (sSMTP sendmail emulation); Sat, 15 Apr 2000 23:49:45 +4400 Date: Sat, 15 Apr 2000 23:49:45 -0400 From: Decklin Foster To: rc@hawkwind.utcs.toronto.edu Subject: matching bug Message-ID: <20000415234945.A16383@photek.dhs.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Mutt/1.0.1i Organization: Society for the Prevention of Cruelty to Vermin I was reminded today that I planned to forward this here: http://www.debian.org/Bugs/db/62/62339.html This is a bug report which notes that rc segfaults if you attempt to match '*' against the null list ("~ () '*'"). unquoted * is ok. A quick trace shows that p->m is null (from what i can gather, this means there are no metacharacters in p->w. documentation on the List structure would be appreciated). This is the line we crash on: if (p->w[i] != '*' || p->m[i] != 1) I'm a bit wary of just taking a check for non-NULL p->m on here, since I don't understand what that means (other than the fact that with an unquoted *, it's a pointer to "\001"). It seems like the function really ought to be rewritten. -- Written with 100% free software. Please support the following websites: www.debian.org www.noamazon.com www.gnu.org www.opendvd.org lpf.ai.mit.edu From rc-owner Mon Apr 17 16:31:18 2000 Received: from newton.hartwick.edu ([147.205.85.10]) by hawkwind.utcs.toronto.edu with SMTP id <25579>; Mon, 17 Apr 2000 16:22:39 -0400 Received: from c26469-a.clnvl1.ct.home.com (147.205.111.20 [147.205.111.20]) by newton.hartwick.edu with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2448.0) id HRZAWDWM; Mon, 17 Apr 2000 15:57:40 -0400 Received: by c26469-a.clnvl1.ct.home.com (sSMTP sendmail emulation); Mon, 17 Apr 2000 15:59:37 -0400 Date: Mon, 17 Apr 2000 15:59:37 -0400 From: Decklin Foster To: Tim Goodwin Cc: rc@hawkwind.utcs.toronto.edu Subject: Re: Bug#62339: rc bug Message-ID: <20000417155937.A29462@photek.dhs.org> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="82I3+IH0IqGh5yIs" User-Agent: Mutt/1.0.1i In-Reply-To: ; from tjg@star.le.ac.uk on Mon, Apr 17, 2000 at 10:25:46AM +0100 Organization: Society for the Prevention of Cruelty to Vermin --82I3+IH0IqGh5yIs Content-Type: text/plain; charset=us-ascii Tim Goodwin writes: > Thanks for the report. I can reproduce this. > > It's not been reported before, so I don't know what's going on, but I'll > let you know as soon as I have a fix. I did send something to to mailing list on Saturday, but it hasn't gotten through yet. I seem to have figured out the use of m in a List structure: if there are no metacharacters, NULL, and if there are, we put a \0 where there's a non-metacharacter in the corresponding part of n, and a \001 where there is. Now in lmatch() when we go through looking for '*'s, we have this loop: for (i = 0; p->w[i] != '\0'; i++) if (p->w[i] != '*' || p->m[i] != 1) { Which assumes that m is as big as w (i.e, not NULL). I came up with this replacement, which works for all the test cases I can think of: if (s == NULL) { if (p == NULL) /* null matches null */ return TRUE; for (; p != NULL; p = p->n) /* one or more stars match null */ if (p->w && strspn(p->w, "*") == strlen(p->w) && p->m && strspn(p->m, "\001") == strlen(p->m)) return TRUE; return FALSE; } I was also able to get rid of 'okay', which i found hard to follow. The comment about the null string is gone too, because IMO the null string fails for the same reason 'foo' fails. There's really no need for an explicit check. A patch is attached. Out of curiosity, why was the decision made to use '\000' and '\001' instead of, say, '0' and '1'? For example in the old code, we have "p->m[i] != 1", and it wouldn't be that hard to write "p->m[i] != '1'" instead. I'm sure there's a reason, but I can't guess it. -- Written with 100% free software. Please support the following websites: www.debian.org www.noamazon.com www.gnu.org www.opendvd.org lpf.ai.mit.edu --82I3+IH0IqGh5yIs Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="rc.patch" --- glob.c.old Wed Oct 21 07:01:46 1998 +++ glob.c Mon Apr 17 15:55:30 2000 @@ -34,23 +34,13 @@ extern bool lmatch(List *s, List *p) { List *q; - int i; - bool okay; if (s == NULL) { if (p == NULL) /* null matches null */ return TRUE; - for (; p != NULL; p = p->n) { /* one or more stars match null */ - if (*p->w != '\0') { /* the null string is a special case; it does *not* match () */ - okay = TRUE; - for (i = 0; p->w[i] != '\0'; i++) - if (p->w[i] != '*' || p->m[i] != 1) { - okay = FALSE; - break; - } - if (okay) - return TRUE; - } - } + for (; p != NULL; p = p->n) /* one or more stars match null */ + if (p->w && strspn(p->w, "*") == strlen(p->w) && + p->m && strspn(p->m, "\001") == strlen(p->m)) + return TRUE; return FALSE; } for (; s != NULL; s = s->n) --82I3+IH0IqGh5yIs-- From rc-owner Tue Apr 18 17:29:03 2000 Received: from newton.hartwick.edu ([147.205.85.10]) by hawkwind.utcs.toronto.edu with SMTP id <25603>; Tue, 18 Apr 2000 17:10:38 -0400 Received: from c26469-a.clnvl1.ct.home.com (147.205.111.20 [147.205.111.20]) by newton.hartwick.edu with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2448.0) id HRZAWJK2; Tue, 18 Apr 2000 00:43:10 -0400 Received: by c26469-a.clnvl1.ct.home.com (sSMTP sendmail emulation); Tue, 18 Apr 2000 00:45:10 -0400 Date: Tue, 18 Apr 2000 00:45:10 -0400 From: Decklin Foster To: rc@hawkwind.utcs.toronto.edu Subject: oops, let's try that one again Message-ID: <20000418004510.A794@photek.dhs.org> References: <20000417155937.A29462@photek.dhs.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Mutt/1.0.1i In-Reply-To: <20000417155937.A29462@photek.dhs.org>; from fosterd@hartwick.edu on Mon, Apr 17, 2000 at 03:59:37PM -0400 Organization: Society for the Prevention of Cruelty to Vermin Decklin Foster writes: > if (p->w && strspn(p->w, "*") == strlen(p->w) && > p->m && strspn(p->m, "\001") == strlen(p->m)) > return TRUE; OK, raise your hand if you can spot the bug here. The test case I came up with after posting this code, which breaks it, is: ~ () *'*' (any number of quoted stars will do.) Not a crasher, but still obviously wrong. Thankfully, the fix involves changing only one character: if (p->w && strspn(p->w, "*") == strlen(p->w) && p->m && strspn(p->m, "\001") == strlen(p->w)) return TRUE; But this of course can be simplified to if (p->w && p->m && strspn(p->w, "*") == strspn(p->m, "\001") == strlen(p->w)) return TRUE; Which is somewhat more efficient, anyway. If you would like me to stop thinking aloud, just speak up, but I don't think this list is suffering from too much traffic ;-) [Note: my normal style would be to pull "== strlen(p->w))" back to the first tab stop and then put "return TRUE;" after it on the same line, but the rc Way seems to be to use if (foo) bar; instead of if (foo) bar; which is what I do for short statements. In short, reformat as you see fit.] -- Written with 100% free software. Please support the following websites: www.debian.org www.noamazon.com www.gnu.org www.opendvd.org lpf.ai.mit.edu From rc-owner Tue Apr 18 17:29:32 2000 Received: from proxy4.ba.best.com ([206.184.139.15]) by hawkwind.utcs.toronto.edu with SMTP id <25609>; Tue, 18 Apr 2000 17:12:02 -0400 Received: from peanut.rakitzis.com (dynamic13.pm01.san-mateo.best.com [205.149.174.13]) by proxy4.ba.best.com (8.9.3/8.9.2/best.out) with ESMTP id XAA28895; Mon, 17 Apr 2000 23:31:38 -0700 (PDT) Received: (from byron@localhost) by peanut.rakitzis.com (8.8.7/8.8.7) id XAA05903; Mon, 17 Apr 2000 23:30:00 -0700 Date: Tue, 18 Apr 2000 02:30:00 -0400 From: Byron Rakitzis Message-Id: <200004180630.XAA05903@peanut.rakitzis.com> To: fosterd@hartwick.edu, tjg@star.le.ac.uk Subject: Re: Bug#62339: rc bug Cc: rc@hawkwind.utcs.toronto.edu Thanks for tracking this down. I'm the original miscreant as far as the documentation style of rc is concerned. Much of this code was written roughly 10 years ago, I'd certainly write it differently now. The metacharacter array is properly an array of booleans. Hence the explicit checks against 0 and 1, which should be cleaned up somehow to reflect their function. A macro "ismeta(p, i)", perhaps. I don't know where the tests against '\001' snuck in. I think it's a mistake. > Now in lmatch() when we go through looking for '*'s, we have this > loop: > > for (i = 0; p->w[i] != '\0'; i++) > if (p->w[i] != '*' || p->m[i] != 1) { > > Which assumes that m is as big as w (i.e, not NULL). I came up with > this replacement, which works for all the test cases I can think of: > > if (s == NULL) { > if (p == NULL) /* null matches null */ > return TRUE; > for (; p != NULL; p = p->n) /* one or more stars match null */ > if (p->w && strspn(p->w, "*") == strlen(p->w) && > p->m && strspn(p->m, "\001") == strlen(p->m)) > return TRUE; > return FALSE; > } > > I was also able to get rid of 'okay', which i found hard to follow. > The comment about the null string is gone too, because IMO the null > string fails for the same reason 'foo' fails. There's really no need > for an explicit check. This is good. I'm picking nits here, but since I obsessed over this code a while ago, I might suggest two small changes to your fix: > if (p->w && strspn(p->w, "*") == strlen(p->w) && > p->m && strspn(p->m, "\001") == strlen(p->m)) to: if (p->m != NULL && strspn(p->w, "*") == strlen(p->w) && strlen(p->m) == strlen(p->w)) Firstly, p->w can not be NULL here; there can be no null words in a word list, only empty strings which are represented as "". As long as you are getting sneaky about using the string library to find zeroes in a character array, you may also rephrase the metacharacter test as two calls to strlen. Byron. From rc-owner Wed Apr 19 16:19:24 2000 Received: from apollo.le.ac.uk ([143.210.16.125]) by hawkwind.utcs.toronto.edu with SMTP id <25636>; Wed, 19 Apr 2000 16:10:50 -0400 Received: from happy.star.le.ac.uk ([143.210.36.58]) by apollo.le.ac.uk with smtp (Exim 3.13 #2) id 12hvdq-00006y-00 for rc@hawkwind.utcs.toronto.edu; Wed, 19 Apr 2000 15:39:46 +0100 Received: (qmail 25249 invoked from network); 19 Apr 2000 14:40:07 -0000 Received: from ltpcg.star.le.ac.uk (tjg@143.210.36.203) by happy.star.le.ac.uk with SMTP; 19 Apr 2000 14:40:07 -0000 To: rc@hawkwind.utcs.toronto.edu In-Reply-To: <200004180630.XAA05903@peanut.rakitzis.com> Subject: Re: Bug#62339: rc bug Date: Wed, 19 Apr 2000 10:39:44 -0400 From: Tim Goodwin Message-ID: A big "thank you!" to Byron and Decklin for getting to the bottom of this bug. I've incorporated their fix, plus a couple of other recent fixes into a new snapshot, which you can get from here. http://www.star.le.ac.uk/~tjg/rc/snap/rc-1.6s20000419.tar.gz This has only been very lightly tested; there might well be some booboos. After the Easter break, I'll scrutinize the changes again, and wrap them into a new beta release. Changes since the last beta are summarized below. Tim. 2000-04-19 Bug: isatty() tests in input.c are relevant to any fd, not just 0. Now `. -i /dev/tty' works right. Bug: fn sigexit wasn't always cleared in child shells. Bug: `~ () '*'' dumped core. From rc-owner Thu Apr 27 12:36:22 2000 Received: from tomts2-srv.bellnexxia.net ([209.226.175.140]) by hawkwind.utcs.toronto.edu with SMTP id <25795>; Thu, 27 Apr 2000 12:27:53 -0400 Received: from localhost ([216.209.181.110]) by tomts2-srv.bellnexxia.net (InterMail vM.4.01.02.17 201-229-119) with SMTP id <20000427030219.QDET1435.tomts2-srv.bellnexxia.net@localhost> for ; Wed, 26 Apr 2000 23:02:19 -0400 Received: from standard input (invoked by user sam) by localhost (0.45) for rc@hawkwind.utcs.utoronto.ca. Status: queued as E2139318; Wed, 26 Apr 2000 15:02:31 est Date: Wed, 26 Apr 2000 11:02:31 -0400 From: Sam Roberts To: rc Subject: building rc on QNX4 Message-Id: <20000426110230.A12715@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.1.11i rc looks really good to me, so I built it over the weekend, and I'm starting to use it. I think I've seen a few problems, but I'll play some more and see what I can turn up, in the meantime, here's what I had to do to get it to build: - it has setpgid(), but not setpgrp(); - it also has a utoa in , but not with the same args; - and it's va_list isn't an lvalue. So, are these patches accpetable? QNX's default bastardized ksh is ok for interactive use, but not great for programming, and I don't think I have to bash bash on the rc mailing list... (sorry, I couldn't resist ;-) Also, there's a few things I've always figured should be easy, like piping fds other than stdout->stdin, that are under rc. Oh, and QNX also lacks a groff tex formatting system... do you think you could distribute a pre-processed rc.1 as rc.man, so it could be read by less? And how about postscript as well (groff -man rc.1>rc.ps)? I found a Linux box to format rc.1 on, but... Anyhow, I'm sure I'll have more questions as I play. So far so good, and thanks a bunch! Sam diff -ur rc-1.6b2-orig/config.h.in rc-1.6b2/config.h.in --- rc-1.6b2-orig/config.h.in Wed Oct 13 07:55:03 1999 +++ rc-1.6b2/config.h.in Tue Apr 25 09:31:27 2000 @@ -107,6 +107,9 @@ /* Define if you have the mkfifo function. */ #undef HAVE_MKFIFO +/* Define if you have the setpgid function. */ +#undef HAVE_SETPGID + /* Define if you have the setpgrp function. */ #undef HAVE_SETPGRP diff -ur rc-1.6b2-orig/configure.in rc-1.6b2/configure.in --- rc-1.6b2-orig/configure.in Fri Dec 10 06:25:53 1999 +++ rc-1.6b2/configure.in Tue Apr 25 09:31:20 2000 @@ -38,7 +38,7 @@ AC_TYPE_UID_T AC_CHECK_TYPE(ssize_t, long) -AC_CHECK_FUNCS(getgroups setpgrp setrlimit strerror) +AC_CHECK_FUNCS(getgroups setpgrp setpgid setrlimit strerror) RC_FUNC_GETGROUPS RC_FUNC_SIGSETJMP diff -ur rc-1.6b2-orig/print.c rc-1.6b2/print.c --- rc-1.6b2-orig/print.c Thu Aug 19 05:22:03 1999 +++ rc-1.6b2/print.c Tue Apr 25 09:36:17 2000 @@ -70,9 +70,9 @@ return FALSE; } -static char *utoa(unsigned long u, char *t, unsigned int radix, const char *digit) { +static char *utostr(unsigned long u, char *t, unsigned int radix, const char *digit) { if (u >= radix) { - t = utoa(u / radix, t, radix, digit); + t = utostr(u / radix, t, radix, digit); u %= radix; } *t++ = digit[u]; @@ -120,7 +120,7 @@ while (*altform != '\0') prefix[pre++] = *altform++; - len = utoa(u, number, radix, table[upper]) - number; + len = utostr(u, number, radix, table[upper]) - number; if ((flags & FMT_f2set) && (size_t) format->f2 > len) zeroes = format->f2 - len; else diff -ur rc-1.6b2-orig/proto.h rc-1.6b2/proto.h --- rc-1.6b2-orig/proto.h Wed Oct 13 10:57:22 1999 +++ rc-1.6b2/proto.h Tue Apr 25 09:37:34 2000 @@ -27,7 +27,11 @@ objects of type va_list. Of course, most places don't have this yet, but where it does exist we need to use it. */ #ifndef __va_copy +#ifndef __QNX__ #define __va_copy(x,y) (x)=(y) +#else +#define __va_copy(x,y) x[0]=y[0] +#endif /* __QNX__ */ #endif #if STDC_HEADERS @@ -84,9 +88,11 @@ #else /* HAVE_SETPGRP */ +#ifndef HAVE_SETPGID /* Nothing doing. */ #define setpgid() #define tcsetpgrp() +#endif /* HAVE_SETPGID */ #endif /*HAVE_SETPGRP */ -- Sam Roberts, sroberts at uniserve dot com, www.emyr.net/Sam From rc-owner Thu Apr 27 16:08:41 2000 Received: from bio.cse.psu.edu ([130.203.12.17]) by hawkwind.utcs.toronto.edu with SMTP id <25828>; Thu, 27 Apr 2000 16:00:46 -0400 Received: (qmail 22506 invoked by uid 991); 27 Apr 2000 16:56:05 -0000 Message-ID: <20000427165605.22504.qmail@g.bio.cse.psu.edu> to: rc Subject: Re: building rc on QNX4 In-Reply-To: Message from Sam Roberts of "Wed, 26 Apr 2000 11:02:31 EDT." <20000426110230.A12715@localhost> Date: Thu, 27 Apr 2000 12:56:05 -0400 From: Scott Schwartz | Oh, and QNX also lacks a groff tex formatting system... do you | think you could distribute a pre-processed rc.1 as rc.man, so | it could be read by less? And how about postscript as well | (groff -man rc.1>rc.ps)? Years ago, Henry Spencer wrote a man-page-only-roff in awk for cnews, for just such a contingency. From rc-owner Fri Apr 28 00:10:44 2000 Received: from aardvark.cogent.ca ([207.112.34.98]) by hawkwind.utcs.toronto.edu with SMTP id <24747>; Thu, 27 Apr 2000 23:22:45 -0400 Received: from sam (sam [192.168.3.20]) by aardvark.cogent.ca (8.9.3/8.8.7) with SMTP id QAA21092 for ; Thu, 27 Apr 2000 16:41:59 -0400 Message-ID: <002701bfb089$027826a0$1403a8c0@cogent.ca> From: "Sam Roberts" To: "rc" References: <20000427165605.22504.qmail@g.bio.cse.psu.edu> Subject: Re: building rc on QNX4 Date: Thu, 27 Apr 2000 16:41:48 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Said Scott Schwartz : > Said Sam : > | Oh, and QNX also lacks a groff tex formatting system... do you > | think you could distribute a pre-processed rc.1 as rc.man, so > | it could be read by less? And how about postscript as well > | (groff -man rc.1>rc.ps)? >=20 > Years ago, Henry Spencer wrote a man-page-only-roff in awk for cnews, > for just such a contingency. That he's such a gifted awk hacker is pretty cool, but I think it's easier to add a rule to the rc build to pack the .man in with the distribution than to find that code! Vrl, for example, has a vrl.man that comes with it. -- Speaking of which, is this an appropriate place to talk about vrl? I posted some diffs to the author, no response yet (only been a day or so -- I'm just mentioning, not griping). I had some trubles with it's termcap usage. It seems to think that @7 is the keypad END key/capability. This wasn't defined on my system, and while I found it defined in a bunch of Linux termcap entries (mostly in what looked like old PC consoles), it wasn't in the ansi entries. Poking around it seemed the right thing was to use kh for HOME and kH for END (vrl was using kh for HOME and @7 for END). Any comments? -- Also, I can't call 'login' from an rc shell, strangely, it complains about not being session leader. I'm quite baffled. I have to look into exactly what it takes to be a session leader, calling setsid() at the beginning of main didn't cut it, and the ps output for a ksh and rc don't seem to show a difference in terms of how the sid, pgrp, and controlling terminal are set up. -- Also, I just noticed ^L doesn't clear the screen. I'll look into that sometime. -- Ciao! Sam From rc-owner Fri Apr 28 16:36:21 2000 Received: from smtp1.libero.it ([193.70.192.51]) by hawkwind.utcs.toronto.edu with SMTP id <24842>; Fri, 28 Apr 2000 16:33:18 -0400 Received: from LocalHost (151.15.135.83) by smtp1.libero.it; 28 Apr 2000 10:46:26 +0200 Received: from carlos by localhost with local (Exim 2.05 #1 (Debian)) id 12ksGS-00040W-00; Thu, 27 Apr 2000 19:39:48 +0200 Date: Thu, 27 Apr 2000 13:39:48 -0400 From: Carlo Strozzi To: rc Subject: Re: building rc on QNX4 Message-ID: <20000427193948.A15307@tango.texne.com> Reply-To: carlos@texne.com Mail-Followup-To: rc References: <20000426110230.A12715@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <20000426110230.A12715@localhost>; from sroberts@uniserve.com on Wed, Apr 26, 2000 at 11:02:31AM -0400 Organization: TeXne.COM On Wed, Apr 26, 2000 at 11:02:31AM -0400, Sam Roberts wrote: > >rc looks really good to me, so I built it over the weekend, and I agree, it is a neat shell, much better than Bourne and derivatives for scripting. I am awful at C programming, but I think adding a few addons to rc should be easy. The only thing that I really miss is a 'read' builtin. Using line(1) did not work, at least on Linux, apart from the fact that being line(1) an external process it is not really efficient, as it is often called from inside a loop. Also, I think that the name 'rc' is sometimes a too short one. On AIX, for instance, it conflicts with the system startup script /etc/rc. I use Linux, so that's not a problem for me, nevertheless I would really like that the default 'make install' stuff set up a symlink to rc with a longer and more meaningful name, like 'rcsh'. cheers -carlo -- Attachments only in HTML/RTF/Postscript please ! Per favore solo attachments in formato HTML/RTF/Postscript ! From rc-owner Fri Apr 28 16:36:29 2000 Received: from janus.ocegr.fr ([194.3.183.34]) by hawkwind.utcs.toronto.edu with SMTP id <24747>; Fri, 28 Apr 2000 16:32:54 -0400 Received: (qmail 723 invoked from network); 28 Apr 2000 07:22:32 -0000 Received: from hydra.ocegr.fr (HELO ocegr.fr) (134.188.135.3) by janus.ocegr.fr with SMTP; 28 Apr 2000 07:22:32 -0000 Received: from alcina.ocegr.fr (alcina.ocegr.fr [134.188.136.183]) by ocegr.fr (8.8.8+Sun/8.8.8) with ESMTP id JAA13012; Fri, 28 Apr 2000 09:29:36 +0200 (MET DST) Message-Id: <4.3.1.2.20000428085436.00b3c4e0@mailhost.ocegr.fr> X-Sender: vons@mailhost.ocegr.fr X-Mailer: QUALCOMM Windows Eudora Version 4.3.1 Date: Fri, 28 Apr 2000 03:28:36 -0400 To: "rc" , "Sam Roberts" From: Gert-Jan Vons Subject: Re: vrl (was: Re: building rc on QNX4) In-Reply-To: <002701bfb089$027826a0$1403a8c0@cogent.ca> References: <20000427165605.22504.qmail@g.bio.cse.psu.edu> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Sam Roberts wrote: >Speaking of which, is this an appropriate place to talk about >vrl? I posted some diffs to the author, no response yet (only >been a day or so -- I'm just mentioning, not griping). That would be me, since I'm the author :-) I assume you sent it to my (old) usa.net address, I'll check my inbox there. >I had some trubles with it's termcap usage. It seems to >think that @7 is the keypad END key/capability. This wasn't >defined on my system, and while I found it defined in a bunch >of Linux termcap entries (mostly in what looked like old PC >consoles), it wasn't in the ansi entries. > >Poking around it seemed the right thing was to use kh for HOME >and kH for END (vrl was using kh for HOME and @7 for END). kH is the "last-line" key according to FreeBSD's termcap(5). What is the OS you are using, what is the tty type, and on what hardware? (please mail me the termcap entry for your tty) "last-line" for going to the end of a line seems a bit strange, but if that is what your tty sends when you hit the End key... I could fall back to kH if there is no @7 defined. >-- >Also, I can't call 'login' from an rc shell, strangely, it >complains about not being session leader. I'm quite baffled. What kind of OS are you using? I can use "login" under solaris and freebsd without any problems. >Also, I just noticed ^L doesn't clear the screen. I'll look >into that sometime. Nope. When you use vrl, ^L redisplays the line, useful in case it got garbled by the output of some background process. Note also that vrl is about lines, it doesn't (want/need to) know about the screen. The unix 'clear' command handles that very well. Gert-Jan ----- "If you are good, you will be assigned all the work. If you are really good, you will get out of it." - Dilbert From rc-owner Fri Apr 28 16:36:37 2000 Received: from aardvark.cogent.ca ([207.112.34.98]) by hawkwind.utcs.toronto.edu with SMTP id <24927>; Fri, 28 Apr 2000 16:33:24 -0400 Received: from sam (sam [192.168.3.20]) by aardvark.cogent.ca (8.9.3/8.8.7) with SMTP id OAA30064; Fri, 28 Apr 2000 14:39:51 -0400 Message-ID: <001801bfb140$f9785760$1403a8c0@cogent.ca> From: "Sam Roberts" To: "rc" , "Gert-Jan Vons" Cc: References: <20000427165605.22504.qmail@g.bio.cse.psu.edu> <4.3.1.2.20000428085436.00b3c4e0@mailhost.ocegr.fr> Subject: Re: vrl (was: Re: building rc on QNX4) Date: Fri, 28 Apr 2000 14:38:40 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 >=20 > >Speaking of which, is this an appropriate place to talk about > >vrl? I posted some diffs to the author, no response yet (only > >been a day or so -- I'm just mentioning, not griping). >=20 > That would be me, since I'm the author :-) I assume you sent it to my=20 > (old) usa.net address, I'll check my inbox there. Yep, that's what's in 1.3's README! ;-) =20 > >I had some trubles with it's termcap usage. It seems to > >think that @7 is the keypad END key/capability. This wasn't > >defined on my system, and while I found it defined in a bunch > >of Linux termcap entries (mostly in what looked like old PC > >consoles), it wasn't in the ansi entries. > > > >Poking around it seemed the right thing was to use kh for HOME > >and kH for END (vrl was using kh for HOME and @7 for END). >=20 > kH is the "last-line" key according to FreeBSD's termcap(5). What is = the=20 > OS you are using, what is the tty type, and on what hardware? (please=20 > mail me the termcap entry for your tty) QNX4, using their pterm (the Photon Terminal, Photon being the GUI system), with ANSI emulation. The esc sequence for END (by observation) is \E[Y, but is not present in their /etc/termcap (I guess most programs are useing terminfo now). Below is the termcap: qansi|qansi-m|qansi-8859m|QNX ANSI:am:G0:co#80:it#8:li#25:ti=3D\E[?7h:\ = :AL=3D\E[%dL:DC=3D\E[%dP:DL=3D\E[%dM:DO=3D\E[%dB:IC=3D\E[%d@:LE=3D\E[%dD:= \ = :RA=3D\E[?7l:RI=3D\E[%dC:SA=3D\E[?7h:SF=3D\E[%dS:SR=3D\E[%dT:UP=3D\E[%dA:= \ = :ae=3D^O:al=3D\E[L:as=3D^N:bt=3D\E[Z:cb=3D\E[K\E[X:cd=3D\E[J:ce=3D\E[K:ch= =3D\E[%i%dG:\ = :cl=3D\E[2J\E[H:cm=3D\E[%i%d;%dH:cs=3D\E[%i%d;%dr:ct=3D\E[2g:dc=3D\E[P:dl= =3D\E[M:do=3D\E[B:\ :ec=3D\E[%dX:ho=3D\E[H:ic=3D\E[@:is=3D\E[?7h\E[0;10;39;49m:\ = :k1=3D\EOP:k2=3D\EOQ:k3=3D\EOR:k4=3D\EOS:k5=3D\EOT:k6=3D\EOU:k7=3D\EOV:k8= =3D\EOW:k9=3D\EOX:\ = :k;=3D\EOY:kB=3D\E[Z:kC=3D\ENa:kD=3D\E[P:kF=3D\E[a:kI=3D\E[@:kN=3D\E[U:kP= =3D\E[V:kR=3D\E[b:kT=3D\ENb:\ = :ka=3D\ENd:kb=3D\177:kd=3D\E[B:kh=3D\E[H:kl=3D\E[D:kr=3D\E[C:ku=3D\E[A:\ = :le=3D\E[D:ll=3D\E[99H:mb=3D\E[5m:md=3D\E[1m:me=3D\E[m^O:mh=3D\E[2m:mk=3D= \E[9m:mr=3D\E[7m:\ :nd=3D\E[C:nw=3D\EE:op=3D\E[39;49m:rp=3D%.\E[%p2%{1}%-%db:\ = :se=3D\E[27m:sf=3D\E[S:so=3D\E[7m:sr=3D\E[T:st=3D\EH:ue=3D\E[24m:up=3D\E[= A:us=3D\E[4m:\ :ac=3D``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~:\ :vb=3D\E[?5h\E[?5l:ve=3D\E[?25h\E[?12l:vi=3D\E[?25l:\ :ws=3D\E[5m:we=3D\E[m:bo=3D\E[1m:be=3D\E[m: So, I can just add ":@7=3D\E[Y:", but I looked at = /usr/lib/terminfo/terminfo.src, and checked out the other emulation pterm can do, the native QNX = terminal type: term terminfo termcap ---- -------- ------- qnx kend=3D\377\250 kH=3D\0377\0250 ansi kend=3D\E[Y Nothing at all... Thus I made the obvious assumption that vrl should use 'kH', and I should add 'kH' to the termcap entry for ansi. Then rc/vrl would work fine with both emulations. It doesn't surprise me that this is wrong, QNX is relatively new, and some of their support for legacy Unix stuff is shaky. So, what's the "right" way? A note in the README for QNX4 users saying to add :@7\E[Y: to "qansi" and :@7=3D\0377\0250: to "qnx" in their termcaps so that all works well? > "last-line" for going to the end of a line seems a bit strange, but if = > that is what your tty sends when you hit the End key... I could fall = back=20 > to kH if there is no @7 defined. >=20 > >Also, I just noticed ^L doesn't clear the screen. I'll look > >into that sometime. >=20 > Nope. When you use vrl, ^L redisplays the line, useful in case it got=20 > garbled by the output of some background process. Note also that vrl = is=20 > about lines, it doesn't (want/need to) know about the screen. The unix = > 'clear' command handles that very well. And fn clear { /bin/echo \f } is working well for me, thanks for the = clarification. Sam From rc-owner Fri Apr 28 16:36:50 2000 Received: from aardvark.cogent.ca ([207.112.34.98]) by hawkwind.utcs.toronto.edu with SMTP id <24950>; Fri, 28 Apr 2000 16:33:30 -0400 Received: from sam (sam [192.168.3.20]) by aardvark.cogent.ca (8.9.3/8.8.7) with SMTP id PAA30351 for ; Fri, 28 Apr 2000 15:04:54 -0400 Message-ID: <002701bfb144$78ca9ca0$1403a8c0@cogent.ca> From: "Sam Roberts" To: "rc" References: <20000427165605.22504.qmail@g.bio.cse.psu.edu> <4.3.1.2.20000428085436.00b3c4e0@mailhost.ocegr.fr> Subject: Re: rc not session leader? Date: Fri, 28 Apr 2000 15:03:42 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 > >Also, I can't call 'login' from an rc shell, strangely, it > >complains about not being session leader. I'm quite baffled. >=20 > What kind of OS are you using? I can use "login" under solaris and=20 > freebsd without any problems. Russ Cox also tells me that login works fine under his system. I kind of expected that rc was working fine everywhere else. ............. And in the process of gathering the ps outputs to post here, I just figured it out. Duh. login has to be *execed*, not forked/and execed. So login is a builtin shell alias for "exec login" in QNX's korn shell, so login gets execed by the shell, the session leader and is happy. I was trying to run login, so login was being execed by a forked child of rc, NOT the session leader, and it was failing. fn login { exec builtin login $* } seems appropriate here... Thanks! Sam From rc-owner Tue May 2 04:56:59 2000 Received: from janus.ocegr.fr ([194.3.183.34]) by hawkwind.utcs.toronto.edu with SMTP id <25460>; Tue, 2 May 2000 04:52:45 -0400 Received: (qmail 9036 invoked from network); 2 May 2000 08:12:24 -0000 Received: from hydra.ocegr.fr (HELO ocegr.fr) (134.188.135.3) by janus.ocegr.fr with SMTP; 2 May 2000 08:12:24 -0000 Received: from alcina.ocegr.fr (alcina.ocegr.fr [134.188.136.183]) by ocegr.fr (8.8.8+Sun/8.8.8) with ESMTP id KAA28403; Tue, 2 May 2000 10:19:28 +0200 (MET DST) Message-Id: <4.3.1.2.20000502092119.00b3ae90@mailhost.ocegr.fr> X-Sender: vons@mailhost.ocegr.fr X-Mailer: QUALCOMM Windows Eudora Version 4.3.1 Date: Tue, 2 May 2000 04:16:15 -0400 To: "Sam Roberts" , "rc" From: Gert-Jan Vons Subject: Re: vrl (was: Re: building rc on QNX4) In-Reply-To: <001801bfb140$f9785760$1403a8c0@cogent.ca> References: <20000427165605.22504.qmail@g.bio.cse.psu.edu> <4.3.1.2.20000428085436.00b3c4e0@mailhost.ocegr.fr> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Sam Roberts wrote: >Yep, that's what's in 1.3's README! ;-) FYI, the latest version of vrl (1.3.2, which includes 2 bug fixes) can be found at http://vons.free.fr/tools/index.html >QNX4, using their pterm (the Photon Terminal, Photon being the GUI >system), with ANSI emulation. The esc sequence for END (by observation) >is \E[Y, but is not present in their /etc/termcap (I guess most programs >are using terminfo now). Below is the termcap: >.... >So, what's the "right" way? A note in the README for QNX4 users saying >to add :@7=\E[Y: to "qansi" and :@7=\0377\0250: to "qnx" in their >termcaps so that all works well? That solution fixes the problem not only for "vrl" but for other termcap-aware programs as well. I registered for a free copy of QNX, so I should be able to have a look at this myself somewhere during the summer. Gert-Jan ----- How come wrong numbers are never busy? From rc-owner Thu May 4 04:12:10 2000 Received: from smtp3.libero.it ([193.70.192.53]) by hawkwind.utcs.toronto.edu with SMTP id <25864>; Thu, 4 May 2000 03:22:47 -0400 Received: from localhost (151.15.145.116) by smtp3.libero.it; 3 May 2000 19:14:07 +0200 Received: from carlos by localhost with local (Exim 2.05 #1 (Debian)) id 12n2h0-000542-00; Wed, 3 May 2000 19:12:10 +0200 Date: Wed, 3 May 2000 13:12:10 -0400 From: Carlo Strozzi To: rc@hawkwind.utcs.utoronto.ca Subject: Re: path oddity Message-ID: <20000503191210.A19441@tango.texne.com> Reply-To: carlos@texne.com Mail-Followup-To: rc@hawkwind.utcs.utoronto.ca Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i Organization: TeXne.COM Regarding my previous message, I forgot to add that if I set a shorter path, like (/bin /usr/bin /usr/local/bin), then everything works fine even without adding the bogus path at the end. bye -carlo -- I can read MIME or uuencoded e-mail attachments in PDF, Postscript, HTML, RTF or text formats. Please do not send Word or Excel files. From rc-owner Thu May 4 04:12:27 2000 Received: from smtp1.libero.it ([193.70.192.51]) by hawkwind.utcs.toronto.edu with SMTP id <25889>; Thu, 4 May 2000 03:23:00 -0400 Received: from LocalHost (151.15.155.172) by smtp1.libero.it; 3 May 2000 23:37:44 +0200 Received: from carlos by localhost with local (Exim 2.05 #1 (Debian)) id 12n3bV-0005E1-00; Wed, 3 May 2000 20:10:33 +0200 Date: Wed, 3 May 2000 14:10:33 -0400 From: Carlo Strozzi To: rc@hawkwind.utcs.utoronto.ca Subject: path oddity = my fault :-/ Message-ID: <20000503201033.A20051@tango.texne.com> Reply-To: carlos@texne.com Mail-Followup-To: rc@hawkwind.utcs.utoronto.ca Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i Organization: TeXne.COM My apologies for the subject "bug" report. It was my fault, due to the fact that I'm a newbie to Rc. I was setting $path in my ~/.rcrc file with: path = ``(:){echo $PATH} while it should have been either: path = ``(:){echo -n $PATH} or: path = ``($ifs :){echo $PATH} bye -carlo -- I can read MIME or uuencoded e-mail attachments in PDF, Postscript, HTML, RTF or text formats. Please do not send Word or Excel files. From rc-owner Thu May 4 04:12:39 2000 Received: from smtp1.libero.it ([193.70.192.51]) by hawkwind.utcs.toronto.edu with SMTP id <25863>; Thu, 4 May 2000 03:22:54 -0400 Received: from LocalHost (151.15.145.116) by smtp1.libero.it; 3 May 2000 19:14:02 +0200 Received: from carlos by localhost with local (Exim 2.05 #1 (Debian)) id 12n2cr-00052U-00; Wed, 3 May 2000 19:07:53 +0200 Date: Wed, 3 May 2000 13:07:52 -0400 From: Carlo Strozzi To: rc@hawkwind.utcs.utoronto.ca Subject: path oddity Message-ID: <20000503190752.B16405@tango.iol.it> Reply-To: carlos@texne.com Mail-Followup-To: rc@hawkwind.utcs.utoronto.ca Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i Organization: TeXne.COM Hi all, I am running Rc 1.5b2 on a Debian GNU/Linux box. I am using rc as a login shell (flag -l), and my $path variable is: /usr/local/bin /usr/bin /bin /usr/X11R6/bin /opt/bin /home/carlos/bin /usr/bin/mh /usr/local/bin/mh Rc seems not to be able to find any commands in the last path token, i.e. /usr/local/bin/mh in this case. Whatever I put last, commands in it are not found (command not found message). As a work-around I have now set a bogus last token, i.e.: /usr/local/bin /usr/bin /bin /usr/X11R6/bin /opt/bin /home/carlos/bin /usr/bin/mh /usr/local/bin/mh /end-of-path and it works fine, in that commands in /usr/local/bin/mh are now found correctly. Sounds like a bug to me :-) bye -carlo -- I can read MIME or uuencoded e-mail attachments in PDF, Postscript, HTML, RTF or text formats. Please do not send Word or Excel files. From rc-owner Thu May 4 04:12:55 2000 Received: from apollo.le.ac.uk ([143.210.16.125]) by hawkwind.utcs.toronto.edu with SMTP id <25221>; Thu, 4 May 2000 03:21:31 -0400 Received: from happy.star.le.ac.uk ([143.210.36.58]) by apollo.le.ac.uk with smtp (Exim 3.13 #2) id 12mdrS-0003Gt-00 for rc@hawkwind.utcs.toronto.edu; Tue, 02 May 2000 15:41:18 +0100 Received: (qmail 5418 invoked from network); 2 May 2000 14:41:35 -0000 Received: from ltpcg.star.le.ac.uk (tjg@143.210.36.203) by happy.star.le.ac.uk with SMTP; 2 May 2000 14:41:35 -0000 To: rc@hawkwind.utcs.toronto.edu Subject: Re: building rc on QNX4 In-Reply-To: <20000427193948.A15307@tango.texne.com> Date: Tue, 2 May 2000 10:41:13 -0400 From: Tim Goodwin Message-ID: > Also, I think that the name 'rc' is sometimes a too short one. On AIX, > for instance, it conflicts with the system startup script /etc/rc. Why is this any more a "conflict" than that between /usr/bin/passwd and /etc/passwd? OK, so /etc/rc is executable, which /etc/passwd isn't, but surely you don't ever want to run /etc/rc by hand? And even if you do, who puts /etc in their path? (I don't use AIX, by the way.) > I use Linux, so that's not a problem for me, nevertheless I would > really like that the default 'make install' stuff set up a symlink > to rc with a longer and more meaningful name, like 'rcsh'. Sounds a bit close to `tcsh' to me :-). But if that's what you want, just say sh configure '--program-suffix=sh' You can also use `--program-prefix' to tack things onto the beginning of the name, or `--program-transform-name' to do arbitrarily weird things to it. Tim. From rc-owner Fri May 5 23:12:10 2000 Received: from aardvark.cogent.ca ([207.112.34.98]) by hawkwind.utcs.toronto.edu with SMTP id <25941>; Fri, 5 May 2000 23:07:01 -0400 Received: from sam.cogent.ca (sam [192.168.3.20]) by aardvark.cogent.ca (8.9.3/8.8.7) with ESMTP id JAA16930 for ; Thu, 4 May 2000 09:46:10 -0400 Date: Thu, 4 May 2000 09:46:09 -0400 From: Sam Roberts Subject: Re: building rc on QNX4 To: rc@hawkwind.utcs.toronto.edu Message-Id: Organization: Cogent Real-Time Systems X-Mailer: Voyager Email for QNX (vmail v2.02) Previously, you (Tim Goodwin) wrote: > > I use Linux, so that's not a problem for me, nevertheless I would > > really like that the default 'make install' stuff set up a symlink > > to rc with a longer and more meaningful name, like 'rcsh'. I like that the name is short, personally. You can call yours whatever you want, but rcsh sounds like the restricted C shell to me... Sam -- Sam Roberts (sam@cogent.ca), Cogent Real-Time Systems (www.cogent.ca) "News is very popular among its readers." - RFC 977 (NNTP) From rc-owner Fri May 5 23:12:16 2000 Received: from smtp2.libero.it ([193.70.192.52]) by hawkwind.utcs.toronto.edu with SMTP id <25946>; Fri, 5 May 2000 23:07:13 -0400 Received: from LocalHost (151.32.183.206) by smtp2.libero.it; 4 May 2000 17:37:12 +0200 Received: from carlos by localhost with local (Exim 2.05 #1 (Debian)) id 12nNC5-0003B6-00; Thu, 4 May 2000 17:05:37 +0200 Date: Thu, 4 May 2000 11:05:37 -0400 From: Carlo Strozzi To: rc@hawkwind.utcs.toronto.edu Subject: Re: path oddity = my fault :-/ Message-ID: <20000504170537.A12184@polka.mi.linux.it> Reply-To: carlos@texne.com Mail-Followup-To: rc@hawkwind.utcs.toronto.edu References: <20000503201033.A20051@tango.texne.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: ; from tjg@star.le.ac.uk on Thu, May 04, 2000 at 09:31:17AM +0100 Organization: TeXne.COM On Thu, May 04, 2000 at 09:31:17AM +0100, Tim Goodwin wrote: (...) >But I don't understand why you want to do this: rc automatically keeps >$path and $PATH synchronized. woops ... I'm afraid I didn't RTFM carefully enough once again :-). Thanks for the hint. Well, at least I'm keeping this list lively :-D bye -carlo -- I can read MIME or uuencoded e-mail attachments in PDF, Postscript, HTML, RTF or text formats. Please do not send Word or Excel files. From rc-owner Fri May 5 23:12:24 2000 Received: from smtp1.libero.it ([193.70.192.51]) by hawkwind.utcs.toronto.edu with SMTP id <25945>; Fri, 5 May 2000 23:07:07 -0400 Received: from LocalHost (151.32.183.206) by smtp1.libero.it; 4 May 2000 17:37:04 +0200 Received: from carlos by localhost with local (Exim 2.05 #1 (Debian)) id 12nNOK-0003Ch-00; Thu, 4 May 2000 17:18:16 +0200 Date: Thu, 4 May 2000 11:18:16 -0400 From: Carlo Strozzi To: rc@hawkwind.utcs.toronto.edu Subject: Re: building rc on QNX4 Message-ID: <20000504171816.B12075@polka.mi.linux.it> Reply-To: carlos@texne.com Mail-Followup-To: rc@hawkwind.utcs.toronto.edu References: <20000427193948.A15307@tango.texne.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: ; from tjg@star.le.ac.uk on Tue, May 02, 2000 at 10:41:13AM -0400 Organization: TeXne.COM On Tue, May 02, 2000 at 10:41:13AM -0400, Tim Goodwin wrote: >> Also, I think that the name 'rc' is sometimes a too short one. On AIX, >> for instance, it conflicts with the system startup script /etc/rc. (...) >Sounds a bit close to `tcsh' to me :-). But if that's what you want, >just say > > sh configure '--program-suffix=sh' Hmm ... that's not the point. What I mean is that the new additional name should be set by the mainstream distribution of Rc, just to acquire such name. This is especially true for Debian GNU/Linux, where whoever acquires a name first "wins". Anyway, this is not at all a big issue, and I am not going to insist on it :-). Mine was just a general concern about using too short names for programs less ubiquitous than /bin/sh. A more important issue IMHO is whether Rc should provide a built-in read function, similar to the one offered by most Bourne shells; another one is whether it will ever make it possible not to export everything to the environment by default. Any thoughts about this ? bye -carlo -- I can read MIME or uuencoded e-mail attachments in PDF, Postscript, HTML, RTF or text formats. Please do not send Word or Excel files. From rc-owner Fri May 5 23:12:48 2000 Received: from proxy2.ba.best.com ([206.184.139.14]) by hawkwind.utcs.toronto.edu with SMTP id <25908>; Fri, 5 May 2000 23:06:55 -0400 Received: from rakitzis.com ([207.20.242.213]) by proxy2.ba.best.com (8.9.3/8.9.2/best.out) with ESMTP id BAA14161; Thu, 4 May 2000 01:46:38 -0700 (PDT) Received: (from byron@localhost) by rakitzis.com (8.9.3/8.9.3) id BAA09376; Thu, 4 May 2000 01:45:52 -0700 Date: Thu, 4 May 2000 04:45:52 -0400 From: Byron Rakitzis Message-Id: <200005040845.BAA09376@rakitzis.com> To: rc@hawkwind.utcs.toronto.edu, tjg@star.le.ac.uk Subject: Re: building rc on QNX4 > to rc with a longer and more meaningful name, like 'rcsh'. I guess I can't shut up -- "rcsh" seems like an abominable name. rc has nothing to do with csh or any of the {tzck}sh family. We may as well call it "rash". Byron. From rc-owner Fri May 5 23:12:54 2000 Received: from apollo.le.ac.uk ([143.210.16.125]) by hawkwind.utcs.toronto.edu with SMTP id <25900>; Fri, 5 May 2000 23:05:52 -0400 Received: from happy.star.le.ac.uk ([143.210.36.58]) by apollo.le.ac.uk with smtp (Exim 3.13 #2) id 12nH2V-0002iC-00 for rc@hawkwind.utcs.toronto.edu; Thu, 04 May 2000 09:31:19 +0100 Received: (qmail 5299 invoked from network); 4 May 2000 08:31:40 -0000 Received: from ltpcg.star.le.ac.uk (tjg@143.210.36.203) by happy.star.le.ac.uk with SMTP; 4 May 2000 08:31:40 -0000 Subject: Re: path oddity = my fault :-/ In-Reply-To: <20000503201033.A20051@tango.texne.com> To: carlos@texne.com CC: rc@hawkwind.utcs.toronto.edu Date: Thu, 4 May 2000 04:31:17 -0400 From: Tim Goodwin Message-ID: > My apologies for the subject "bug" report. It was my fault, due to > the fact that I'm a newbie to Rc. I was setting $path in my ~/.rcrc > file with: > path = ``(:){echo $PATH} I'm glad you got to the bottom of the problem. (Don't feel too badly; I've made the same mistake myself of removing NL from $ifs, and forgetting that it will be then be preserved in backquote substitutions.) But I don't understand why you want to do this: rc automatically keeps $path and $PATH synchronized. Tim. From rc-owner Sat May 6 17:55:36 2000 Received: from waltz.mi.linux.it ([195.212.120.10]) by hawkwind.utcs.toronto.edu with SMTP id <26092>; Sat, 6 May 2000 17:41:16 -0400 Received: from ip-2nd.mi.linux.it (localhost) [195.212.120.11] (mail) by waltz.mi.linux.it with esmtp (Exim 2.05 #1) id 12o5CB-0006gA-00 (Debian); Sat, 6 May 2000 16:04:39 +0200 Received: from carlos by localhost with local (Exim 2.05 #1 (Debian)) id 12o1pE-0003bV-00; Sat, 6 May 2000 12:28:44 +0200 Date: Sat, 6 May 2000 06:28:44 -0400 From: Carlo Strozzi To: rc@hawkwind.utcs.toronto.edu Subject: Re: building rc on QNX4 Message-ID: <20000506122844.A13794@tango.texne.com> Reply-To: carlos@texne.com Mail-Followup-To: rc@hawkwind.utcs.toronto.edu References: <200005040845.BAA09376@rakitzis.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <200005040845.BAA09376@rakitzis.com>; from byron@rakitzis.com on Thu, May 04, 2000 at 04:45:52AM -0400 Organization: TeXne.COM On Thu, May 04, 2000 at 04:45:52AM -0400, Byron Rakitzis wrote: >> to rc with a longer and more meaningful name, like 'rcsh'. > >I guess I can't shut up -- "rcsh" seems like an abominable name. > >rc has nothing to do with csh or any of the {tzck}sh family. > >We may as well call it "rash". Well, why not :-). Even calling it by it's name, that is Rc, would be reasonable. The mixed-casing would make it unique enough. --carlo -- I can read MIME or uuencoded e-mail attachments in PDF, Postscript, HTML, RTF or text formats. Please do not send Word or Excel files. From rc-owner Sat May 6 18:04:28 2000 Received: from gw.goop.org ([206.170.148.147]) by hawkwind.utcs.toronto.edu with SMTP id <26094>; Sat, 6 May 2000 17:41:58 -0400 Received: from ixodes.goop.org (ixodes [192.168.0.5]) by gw.goop.org (Postfix) with ESMTP id 7AA3362002; Sat, 6 May 2000 09:35:08 -0700 (PDT) Received: by ixodes.goop.org (Postfix, from userid 223) id 22FDDACDE6; Sat, 6 May 2000 09:35:04 -0700 (PDT) Content-Length: 367 Message-ID: X-Mailer: XFMail 1.4.4 on Linux X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <200005040845.BAA09376@rakitzis.com> Date: Sat, 6 May 2000 12:35:04 -0400 From: Jeremy Fitzhardinge To: Byron Rakitzis Subject: Re: building rc on QNX4 Cc: tjg@star.le.ac.uk, rc@hawkwind.utcs.toronto.edu On 04-May-2000 Byron Rakitzis wrote: >> to rc with a longer and more meaningful name, like 'rcsh'. > > I guess I can't shut up -- "rcsh" seems like an abominable name. > > rc has nothing to do with csh or any of the {tzck}sh family. > > We may as well call it "rash". 9sh would be consistent with some other names (9term, 9wm, etc). But I prefer rc. J From rc-owner Sun May 7 23:59:52 2000 Received: from adsl-216-102-199-169.dsl.snfc21.pacbell.net ([63.203.198.9]) by hawkwind.utcs.toronto.edu with SMTP id <25325>; Sun, 7 May 2000 23:51:21 -0400 Received: (from haahr@localhost) by adsl-216-102-199-169.dsl.snfc21.pacbell.net (8.8.7/8.8.7) id KAA07261; Sun, 7 May 2000 10:46:31 -0700 X-Authentication-Warning: iadd.jivetech.com: haahr set sender to haahr@jivetech.com using -f From: Paul Haahr X-Attribution: haahr Message-Id: Date: Sun, 7 May 2000 13:46:31 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: carlos@texne.com Cc: rc@hawkwind.utcs.toronto.edu Subject: Re: building rc on QNX4 In-Reply-To: <20000506122844.A13794@tango.texne.com> References: <200005040845.BAA09376@rakitzis.com> <20000506122844.A13794@tango.texne.com> X-Mailer: VM 6.30 under Emacs 20.3.1 Carlo Strozzi wrote > Even calling it by it's name, that is Rc, would be reasonable. The > mixed-casing would make it unique enough. And is the absolute worst suggestion we've had so far. Some of us have happily used Byron's rc for nearly a decade (others have used the Plan 9 version for even longer) and the name has worked well for all that time. Please just forget about changing the name. If you want to use it with another name, you know how to do it. But the name of the executbale is rc, and changing that is not worth discussing. --p From rc-owner Mon May 8 00:00:06 2000 Received: from proxy2.ba.best.com ([206.184.139.14]) by hawkwind.utcs.toronto.edu with SMTP id <24842>; Sun, 7 May 2000 23:50:52 -0400 Received: from rakitzis.com ([207.20.242.213]) by proxy2.ba.best.com (8.9.3/8.9.2/best.out) with ESMTP id OAA03349 for ; Sat, 6 May 2000 14:48:23 -0700 (PDT) Received: (from byron@localhost) by rakitzis.com (8.9.3/8.9.3) id OAA18369 for rc@hawkwind.utcs.toronto.edu; Sat, 6 May 2000 14:47:45 -0700 Date: Sat, 6 May 2000 17:47:45 -0400 From: Byron Rakitzis Message-Id: <200005062147.OAA18369@rakitzis.com> To: rc@hawkwind.utcs.toronto.edu Subject: Re: building rc on QNX4 >Well, why not :-). Even calling it by it's name, that is Rc, would >be reasonable. The mixed-casing would make it unique enough. Let's see, the Unix port of rc has been around for nearly 10 years. What compelling reason is there to change its name now? Byron. From rc-owner Mon May 8 05:04:35 2000 Received: from localhost by hawkwind.utcs.toronto.edu with SMTP id <25678>; Mon, 8 May 2000 05:03:25 -0400 To: rc Subject: Re: building rc on QNX4 In-Reply-To: Date: Mon, 8 May 2000 04:58:21 -0400 From: Chris Siebenmann Message-Id: <00May8.050325edt.25678@hawkwind.utcs.toronto.edu> | There is no *need* to make `read' a builtin: see the EXAMPLES file in | the distribution for an alternative. Unfortunately the example doesn't work in several very useful situations: it will badly flub the common scripting idiom of 'generate stuff | {while (read foo) {....}}', never processing most of the actual output. In order to make this work, you need to find a utility that is guaranteed to read no more than the first line of standard input. Most utilities (eg awk) will happily eat an entire large buffer worth of standard input and then give you the first line back. This is unfortunate if you wanted to read the rest of the buffer's worth of input later. read is the one extra command that I really think should be a builtin. I believe there are good versions that are simple to add (through the existing hooks) in the mailing list archives[*]. - cks [*: ftp://ftp.sys.utoronto.ca/pub/rc/ for new people.] From rc-owner Mon May 8 05:04:40 2000 Received: from apollo.le.ac.uk ([143.210.16.125]) by hawkwind.utcs.toronto.edu with SMTP id <25676>; Mon, 8 May 2000 05:03:19 -0400 Received: from happy.star.le.ac.uk ([143.210.36.58]) by apollo.le.ac.uk with smtp (Exim 3.13 #2) id 12oivL-0003lp-00 for rc@hawkwind.utcs.toronto.edu; Mon, 08 May 2000 09:29:55 +0100 Received: (qmail 10156 invoked from network); 8 May 2000 08:30:17 -0000 Received: from ltpcg.star.le.ac.uk (tjg@143.210.36.203) by happy.star.le.ac.uk with SMTP; 8 May 2000 08:30:17 -0000 To: rc@hawkwind.utcs.toronto.edu Subject: Re: building rc on QNX4 In-Reply-To: <20000504171816.B12075@polka.mi.linux.it> Date: Mon, 8 May 2000 04:29:54 -0400 From: Tim Goodwin Message-ID: > A more important issue IMHO is whether Rc should provide a built-in > read function, similar to the one offered by most Bourne shells; There is no *need* to make `read' a builtin: see the EXAMPLES file in the distribution for an alternative. One of rc's design goals is to avoid unnecessary builtins. So, no, I don't think this is likely to happen. (I accept that there is some work to be done, first in terms of documentation: the EXAMPLES file is not as visible as it should be. Also, I have some vague ideas for the future about a package of small utilities to work with rc (and other shells); one of these would be something like `line'---unfortunately not available everywhere---and make a building block for an efficient `read' function.) > another > one is whether it will ever make it possible not to export everything to > the environment by default. I brought this up a few months ago, and the consensus seemed to be that the current scheme works well enough in practice. Have you encountered a problem? Tim. From rc-owner Mon May 8 05:04:46 2000 Received: from waltz.mi.linux.it ([195.212.120.10]) by hawkwind.utcs.toronto.edu with SMTP id <25666>; Mon, 8 May 2000 05:03:01 -0400 Received: from ip-2nd.mi.linux.it (localhost) [195.212.120.11] (mail) by waltz.mi.linux.it with esmtp (Exim 2.05 #1) id 12oiXg-0006RE-00 (Debian); Mon, 8 May 2000 10:05:28 +0200 Received: from carlos by localhost with local (Exim 2.05 #1 (Debian)) id 12oiU3-0004Fv-00; Mon, 8 May 2000 10:01:43 +0200 Date: Mon, 8 May 2000 04:01:43 -0400 From: Carlo Strozzi To: Paul Haahr Cc: rc@hawkwind.utcs.toronto.edu Subject: Re: building rc on QNX4 Message-ID: <20000508100143.A16243@tango.texne.com> Reply-To: carlos@texne.com Mail-Followup-To: Paul Haahr , rc@hawkwind.utcs.toronto.edu References: <200005040845.BAA09376@rakitzis.com> <20000506122844.A13794@tango.texne.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: ; from haahr@jivetech.com on Sun, May 07, 2000 at 01:46:31PM -0400 Organization: TeXne.COM On Sun, May 07, 2000 at 01:46:31PM -0400, Paul Haahr wrote: >Carlo Strozzi wrote >> Even calling it by it's name, that is Rc, would be reasonable. The >> mixed-casing would make it unique enough. > >And is the absolute worst suggestion we've had so far. > >Some of us have happily used Byron's rc for nearly a decade (others have >used the Plan 9 version for even longer) and the name has worked well >for all that time. > >Please just forget about changing the name. If you want to use it with >another name, you know how to do it. But the name of the executbale is >rc, and changing that is not worth discussing. Apart from the fact that I didn't suggest to change its name, but just to add a symlink in the stock 'make install' stuff (9sh is the best one I've heard so far), it's interesting to see how that admittedly irrelevant topic spawned more replies than the other two in the same message, i.e. how about having a 'read' builtin and not exporting every sort of stuff to the environment by default. Even if I added such features myself -- I'm awful at C --, they would not be part of the standard distribution, that's why I'm asking for an opinion here. bye -carlo -- I can read MIME or uuencoded e-mail attachments in PDF, Postscript, HTML, RTF or text formats. Please do not send Word or Excel files. From rc-owner Mon May 8 05:59:32 2000 Received: from apollo.le.ac.uk ([143.210.16.125]) by hawkwind.utcs.toronto.edu with SMTP id <25685>; Mon, 8 May 2000 05:57:57 -0400 Received: from happy.star.le.ac.uk ([143.210.36.58]) by apollo.le.ac.uk with smtp (Exim 3.13 #2) id 12ojd0-0004S5-00 for rc@hawkwind.utcs.toronto.edu; Mon, 08 May 2000 10:15:02 +0100 Received: (qmail 12054 invoked from network); 8 May 2000 09:15:23 -0000 Received: from ltpcg.star.le.ac.uk (tjg@143.210.36.203) by happy.star.le.ac.uk with SMTP; 8 May 2000 09:15:23 -0000 Subject: Re: building rc on QNX4 To: rc@hawkwind.utcs.toronto.edu In-Reply-To: <00May8.050325edt.25678@hawkwind.utcs.toronto.edu> Date: Mon, 8 May 2000 05:15:01 -0400 From: Tim Goodwin Message-ID: > In order to make this work, you need to find a utility that is > guaranteed to read no more than the first line of standard input. Yup. What if such a utility were distributed with rc, or as part of an rc-utils package? > read is the one extra command that I really think should be a > builtin. OK. Any other views? Tim. From rc-owner Mon May 8 18:56:37 2000 Received: from fw.softwell.se ([193.15.236.45]) by hawkwind.utcs.toronto.edu with SMTP id <25704>; Mon, 8 May 2000 18:51:24 -0400 Received: from trillian.softwell.se (IDENT:bengt@trillian.softwell.se [192.42.172.11]) by fw.softwell.se (8.9.3/8.9.3) with ESMTP id MAA01127; Mon, 8 May 2000 12:19:15 +0200 Received: (from bengt@localhost) by trillian.softwell.se (8.8.7/8.8.7) id MAA24015; Mon, 8 May 2000 12:19:15 +0200 Date: Mon, 8 May 2000 06:19:15 -0400 From: Bengt Kleberg Message-Id: <200005081019.MAA24015@trillian.softwell.se> To: rc@hawkwind.utcs.toronto.edu, tjg@star.le.ac.uk Subject: Re: building rc on QNX4 > From: Tim Goodwin > > In order to make this work, you need to find a utility that is > > guaranteed to read no more than the first line of standard input. > What if such a utility were distributed with rc Good enough for me. And please call it 'read' if it will help. Best Wishes, Bengt =============================================================== Everything aforementioned should be regarded as totally private opinions, and nothing else. bengt@softwell.se ``His great strength is that he is uncompromising. It would make him physically ill to think of programming in C++.'' From rc-owner Mon May 8 18:56:45 2000 Received: from aardvark.cogent.ca ([207.112.34.98]) by hawkwind.utcs.toronto.edu with SMTP id <25790>; Mon, 8 May 2000 18:52:14 -0400 Received: from sam.cogent.ca (sam [192.168.3.20]) by aardvark.cogent.ca (8.9.3/8.8.7) with ESMTP id LAA16898 for ; Mon, 8 May 2000 11:23:57 -0400 Date: Mon, 8 May 2000 11:23:57 -0400 From: Sam Roberts Subject: Re: building rc on QNX4 To: rc@hawkwind.utcs.toronto.edu Message-Id: Organization: Cogent Real-Time Systems X-Mailer: Voyager Email for QNX (vmail v2.02) Previously, you (Carlo Strozzi) wrote: > A more important issue IMHO is whether Rc should provide a built-in > read function, similar to the one offered by most Bourne shells; another > one is whether it will ever make it possible not to export everything to > the environment by default. > > Any thoughts about this ? Did you search the mailing list archive? Somebody might have posted code to do this. Sam -- Sam Roberts (sam@cogent.ca), Cogent Real-Time Systems (www.cogent.ca) "News is very popular among its readers." - RFC 977 (NNTP) From rc-owner Mon May 8 18:56:51 2000 Received: from sunny.pacific.net.au ([210.23.129.40]) by hawkwind.utcs.toronto.edu with SMTP id <25708>; Mon, 8 May 2000 18:51:55 -0400 Received: from wisma.pacific.net.au (wisma.pacific.net.au [210.23.129.72]) by sunny.pacific.net.au with ESMTP id VAA08710; Mon, 8 May 2000 21:50:19 +1000 (EST) Received: from typhaon.pacific.net.au (typhaon.pacific.net.au [210.23.128.128]) by wisma.pacific.net.au with ESMTP id VAA17928; Mon, 8 May 2000 21:50:18 +1000 (EST) Received: from pacific.net.au (luyer@localhost [127.0.0.1]) by typhaon.pacific.net.au (8.9.3/8.9.3/Debian 8.9.3-21) with ESMTP id VAA20547; Mon, 8 May 2000 21:50:18 +1000 Message-Id: <200005081150.VAA20547@typhaon.pacific.net.au> X-Authentication-Warning: typhaon.pacific.net.au: Host luyer@localhost [127.0.0.1] claimed to be pacific.net.au X-Mailer: exmh version 2.1.1 10/15/1999 (debian) To: Tim Goodwin cc: rc@hawkwind.utcs.toronto.edu Subject: Re: building rc on QNX4 In-Reply-To: Message from Tim Goodwin of "Mon, 08 May 2000 04:29:54 -0400." References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 8 May 2000 07:50:18 -0400 From: David Luyer Tim Goodwin wrote: > > another > > one is whether it will ever make it possible not to export everything to > > the environment by default. > > I brought this up a few months ago, and the consensus seemed to be that > the current scheme works well enough in practice. Have you encountered > a problem? I encountered a problem with this years ago but just started using "su -" when I was trying to get programs to run that it broke. Basically some OS's (Digital Unix for one I think) have C libraries which choke horribly if the size of the command line + environment array is greater than a certain value, and if you have a number of complex functions in your shell this value (64k?) can be a pain. Although it is really useful to have the shell functions inherited by a shell which was spawned from some unrelated program running under the initial shell, maybe we need some way to prevent this in specific cases? Maybe some syntax along the lines of: (+ HOME PATH path USER LOGNAME "fn "*) /usr/sbin/cron & to pass HOME, PATH, path, USER, LOGNAME and fn_* only (- "fn "*) /usr/sbin/cron & to pass everything but fn_* But then - as with most things this could be done in a function eg: run sh with HOME USER LOGNAME run sh without "fn "* which could be implemented relatively easily if there was an option to whatis to just list variables instead of show what they are. (eg: "whatis -fq" - list functions, "whatis -vq" - list variables) Anyway - basically - I think it might be more useful to extend whatis such that it can be used to implement easily a facility to run a command without any environment variables, rather than to actually implement that facility internally. David. -- ---------------------------------------------- David Luyer Senior Network Engineer Pacific Internet (Aust) Pty Ltd Phone: +61 3 9674 7525 Fax: +61 3 9699 8693 Mobile: +61 4 1064 2258, +61 4 1114 2258 http://www.pacific.net.au NASDAQ: PCNTF << fast 'n easy >> ---------------------------------------------- From rc-owner Mon May 8 18:56:59 2000 Received: from pantransit.reptiles.org ([209.157.133.146]) by hawkwind.utcs.toronto.edu with SMTP id <25789>; Mon, 8 May 2000 18:52:08 -0400 Received: (qmail 23584 invoked by uid 204); 8 May 2000 15:15:02 -0000 Date: Mon, 8 May 2000 11:15:02 -0400 Message-ID: <20000508151502.23583.qmail@pantransit.reptiles.org> From: "Smarasderagd" To: cks@hawkwind.utcs.toronto.edu, rc@hawkwind.utcs.toronto.edu Subject: Re: building rc on QNX4 Chris Siebenmann writes: > Unfortunately the example doesn't work in several very useful >situations: it will badly flub the common scripting idiom of >'generate stuff | {while (read foo) {....}}', never processing >most of the actual output. My usual way through this situation has been to recode it as for (i in `{generate stuff}) {...} replacing ` with ``($nl) if I really want lines and not tokens. If the input is big enough to cause problems for rc, I switch to awk, sed, or whatever. Complicated interactive scripts I usually write in awk/gawk. This won't work to interact with a network connection, such as the news and FTP snarfing scripts I use (see below.) > In order to make this work, you need to find a utility that is >guaranteed to read no more than the first line of standard input. >Most utilities (eg awk) will happily eat an entire large buffer >worth of standard input and then give you the first line back. >This is unfortunate if you wanted to read the rest of the buffer's >worth of input later. I wrote a tiny C program "line" that reads a character at a time to ensure that further input doesn't get eaten, and another one "spew" to handle the "." on a line by itself ending a block of output protocol used by news, mail, and others. "line" wouldn't be necessary if news didn't respond to article requests etc. with a response code line immediately followed by the output. You may notice that SMTP/NNTP don't put the server in this situation... From rc-owner Mon May 8 18:57:12 2000 Received: from spring.ibm.it ([194.196.12.228]) by hawkwind.utcs.toronto.edu with SMTP id <25787>; Mon, 8 May 2000 18:52:02 -0400 Received: from localhost ([194.196.12.130]) by spring.ibm.it (Post.Office MTA v3.1 release PO203a ID# 167-37756U2010L100S0) with ESMTP id AAA39894 for ; Mon, 8 May 2000 17:01:23 +0200 Received: from carlos by localhost with local (Exim 2.05 #1 (Debian)) id 12onZq-0003L8-00; Mon, 8 May 2000 15:28:02 +0200 Date: Mon, 8 May 2000 09:28:02 -0400 From: Carlo Strozzi To: rc@hawkwind.utcs.toronto.edu Subject: Re: building rc on QNX4 Message-ID: <20000508152802.A12803@polka.mi.linux.it> Reply-To: carlos@texne.com Mail-Followup-To: rc@hawkwind.utcs.toronto.edu References: <20000504171816.B12075@polka.mi.linux.it> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="45Z9DzgjV8m4Oswq" X-Mailer: Mutt 1.0i In-Reply-To: ; from tjg@star.le.ac.uk on Mon, May 08, 2000 at 04:29:54AM -0400 Organization: TeXne.COM --45Z9DzgjV8m4Oswq Content-Type: text/plain; charset=us-ascii On Mon, May 08, 2000 at 04:29:54AM -0400, Tim Goodwin wrote: >> A more important issue IMHO is whether Rc should provide a built-in >> read function, similar to the one offered by most Bourne shells; > >There is no *need* to make `read' a builtin: see the EXAMPLES file in >the distribution for an alternative. One of rc's design goals is to >avoid unnecessary builtins. So, no, I don't think this is likely to >happen. > Unfortunately the example provided does not work the way 'read' does, and is an extra-process that needs to be spawned for each input line. >> one is whether it will ever make it possible not to export everything to >> the environment by default. > >I brought this up a few months ago, and the consensus seemed to be that >the current scheme works well enough in practice. Have you encountered >a problem? hmm ... not really. Mine is just a general concern. Currently I initialize every variable that I'm going to use in a script, right at the beginning of the program, somewhat like what you do with C whan you declare things first. That is because unless I maintain a global name-space I never know what a variable is going to contain when the program is called. Having a clean environment would be desirable in general. Anyway, the above is another minor issue, it may as well be that the current scheme is ok. What I _really_ miss is a 'read', or 'line', function, for record-oriented input, and I think this feeling is shared also by others. While things like 'test' are rarely called inside a loop, reading lines from a file is the opposite, and spawning an external process on each line sucks, especially when one uses the shell for writing Web CGI scripts, like I do. Beside all that, I am a long-time (Bourne) shell user, and I whish I had uncovered rc before :-) Anyway, just to give my two-cent and not just ask for things :-), here are a couple of functions to emulate often-used external processes like basename(1) and dirname(1). I've tried to mimic the respective utilities as closely as I could. Bug-fixes are welcome :-) bye -carlo -- I can read MIME or uuencoded e-mail attachments in PDF, Postscript, HTML, RTF or text formats. Please do not send Word or Excel files. --45Z9DzgjV8m4Oswq Content-Type: text/plain Content-Disposition: attachment; filename="rcstuff.txt" # # Emulate dirname(1) # fn DirName { ~ $1 () && { echo DirName: too few arguments >[1=2] ; return 1 } ~ $1 '' .* && { echo . ; return } ~ $1 / && { echo / ; return } x=() y=() { x = ``(/) {echo -n $1} ~ $1 /* && ~ $x(2) () && { echo / ; return } ~ $x(2) () && { echo . ; return } * = $x while (!~ $#* 0 1) { y = $y/$1 ; shift } echo $y } } # # Emulate basename(1) # fn BaseName { ~ $1 () && { echo BaseName: too few arguments >[1=2] ; return 1 } ~ $1 '' / && return x = () { x = ``(/) {echo -n $1} echo $x($#x) } } # End of stuff. --45Z9DzgjV8m4Oswq-- From rc-owner Tue May 9 18:59:24 2000 Received: from pantransit.reptiles.org ([209.157.133.146]) by hawkwind.utcs.toronto.edu with SMTP id <24842>; Tue, 9 May 2000 18:54:08 -0400 Received: (qmail 2857 invoked by uid 204); 9 May 2000 04:34:20 -0000 Date: Tue, 9 May 2000 00:34:20 -0400 Message-ID: <20000509043420.2856.qmail@pantransit.reptiles.org> From: "Smarasderagd" To: david_luyer@pacific.net.au, tjg@star.le.ac.uk Subject: Re: building rc on QNX4 Cc: rc@hawkwind.utcs.toronto.edu David Luyer writes: >Basically some OS's (Digital Unix for one I think) have C libraries which >choke horribly if the size of the command line + environment array is greater >than a certain value, and if you have a number of complex functions in your >shell this value (64k?) can be a pain. In some cases this limit is enforced by the operating system; execve() chokes on Linux if the arguments plus environment exceed (I think) 128K. >Anyway - basically - I think it might be more useful to extend whatis such >that it can be used to implement easily a facility to run a command without >any environment variables, rather than to actually implement that facility >internally. If you don't need to export anything but non-array variables, the "-i" or "-" option to "env" does what you want. For the other cases: You could have a whatis option (or a gnarly function that understands enough rc syntax not to be fooled by newlines in quoted strings) that spews null assignments / definitions for everything, and then eval the result filtered for the things you want to preserve, but eeuugh. If a function is that big it won't be much slower if it's a script instead. From rc-owner Tue May 9 19:00:00 2000 Received: from wren.cs.unc.edu ([152.2.128.86]) by hawkwind.utcs.toronto.edu with SMTP id <25883>; Tue, 9 May 2000 18:53:15 -0400 Received: from rukbat.cs.unc.edu (rukbat.cs.unc.edu [152.2.133.170]) by wren.cs.unc.edu (8.9.3/8.9.3) with ESMTP id TAA14087 for ; Mon, 8 May 2000 19:25:26 -0400 (EDT) Received: (from tell@localhost) by rukbat.cs.unc.edu (8.9.3/8.9.3) id TAA29982; Mon, 8 May 2000 19:25:25 -0400 (EDT) Date: Mon, 8 May 2000 19:25:25 -0400 From: Stephen Tell To: rc@hawkwind.utcs.toronto.edu Subject: Re: building rc on QNX4 In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Mon, 8 May 2000, Tim Goodwin wrote: > Date: Mon, 8 May 2000 05:15:01 -0400 > From: Tim Goodwin > To: rc@hawkwind.utcs.toronto.edu > Subject: Re: building rc on QNX4 > > > In order to make this work, you need to find a utility that is > > guaranteed to read no more than the first line of standard input. > > Yup. What if such a utility were distributed with rc, or as part of an > rc-utils package? I suppose that would be sufficient. The workaround I've used has been this: var = `{sh -c 'read t; echo $t'} # read var Starting up sh just to avoid the little bit of code that a read builtin would add to rc itself or an included utility seems a bit rediculous. -- Steve Tell | tell@cs.unc.edu | http://www.cs.unc.edu/~tell | KF4ZPF On Leave from UNC working at Chip2Chip, Inc. tell@chip2chip.com/919-929-0991 From rc-owner Tue May 9 19:00:06 2000 Received: from smtp3.libero.it ([193.70.192.53]) by hawkwind.utcs.toronto.edu with SMTP id <25704>; Tue, 9 May 2000 18:54:20 -0400 Received: from LocalHost (151.32.162.205) by smtp3.libero.it; 9 May 2000 10:29:49 +0200 Received: from carlos by localhost with local (Exim 2.05 #1 (Debian)) id 12p5L0-0002Ae-00; Tue, 9 May 2000 10:25:54 +0200 Date: Tue, 9 May 2000 04:25:54 -0400 From: Carlo Strozzi To: rc@hawkwind.utcs.toronto.edu Subject: Re: building rc on QNX4 Message-ID: <20000509102554.B8231@tango.iol.it> Reply-To: carlos@texne.com Mail-Followup-To: rc@hawkwind.utcs.toronto.edu References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: ; from sam@cogent.ca on Mon, May 08, 2000 at 11:23:57AM -0400 Organization: TeXne.COM On Mon, May 08, 2000 at 11:23:57AM -0400, Sam Roberts wrote: >Previously, you (Carlo Strozzi) wrote: >> A more important issue IMHO is whether Rc should provide a built-in >> read function, similar to the one offered by most Bourne shells; another >> one is whether it will ever make it possible not to export everything to >> the environment by default. >> >> Any thoughts about this ? > >Did you search the mailing list archive? Somebody might have posted >code to do this. No, I didn't. Thanks for the suggestion. Actually I am experiencing some delay in receiving messages from the list, and I apologize with the other subscribers if sometimes I seem to be asking questions that have already been replied by others. bye -carlo -- I can read MIME or uuencoded e-mail attachments in PDF, Postscript, HTML, RTF or text formats. Please do not send Word or Excel files. From rc-owner Tue May 9 19:02:34 2000 Received: from smtp2.libero.it ([193.70.192.52]) by hawkwind.utcs.toronto.edu with SMTP id <25708>; Tue, 9 May 2000 18:54:15 -0400 Received: from LocalHost (151.32.162.205) by smtp2.libero.it; 9 May 2000 10:29:54 +0200 Received: from carlos by localhost with local (Exim 2.05 #1 (Debian)) id 12p5Hj-0002AD-00; Tue, 9 May 2000 10:22:31 +0200 Date: Tue, 9 May 2000 04:22:31 -0400 From: Carlo Strozzi To: rc@hawkwind.utcs.toronto.edu Subject: Re: building rc on QNX4 Message-ID: <20000509102231.A8231@tango.iol.it> Reply-To: carlos@texne.com Mail-Followup-To: rc@hawkwind.utcs.toronto.edu References: <20000508151502.23583.qmail@pantransit.reptiles.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <20000508151502.23583.qmail@pantransit.reptiles.org>; from smarry@vex.net on Mon, May 08, 2000 at 11:15:02AM -0400 Organization: TeXne.COM On Mon, May 08, 2000 at 11:15:02AM -0400, Smarasderagd wrote: (...) >replacing ` with ``($nl) if I really want lines and not tokens. If the >input is big enough to cause problems for rc, I switch to awk, sed, or >whatever. Complicated interactive scripts I usually write in awk/gawk. awk and sed are great tools, but the problem with awk is that any interactions with external utilities spawns an extra /bin/sh process, wich sucks a hell of a lot in Web CGI scripts. That's why using a shell in the first place, with a bit of care, tends to be more efficient. And awk does not even have an 'exec' facility, that would also help with saving processes. bye -carlo -- I can read MIME or uuencoded e-mail attachments in PDF, Postscript, HTML, RTF or text formats. Please do not send Word or Excel files. From rc-owner Thu May 11 18:02:33 2000 Received: from janus.ocegr.fr ([194.3.183.34]) by hawkwind.utcs.toronto.edu with SMTP id <26118>; Thu, 11 May 2000 16:55:15 -0400 Received: (qmail 15182 invoked from network); 11 May 2000 12:19:31 -0000 Received: from hydra.ocegr.fr (HELO ocegr.fr) (134.188.135.3) by janus.ocegr.fr with SMTP; 11 May 2000 12:19:31 -0000 Received: from alcina.ocegr.fr (alcina.ocegr.fr [134.188.136.183]) by ocegr.fr (8.8.8+Sun/8.8.8) with ESMTP id OAA12715; Thu, 11 May 2000 14:26:33 +0200 (MET DST) Message-Id: <4.3.1.2.20000511140729.00b2aca0@mailhost.ocegr.fr> X-Sender: vons@mailhost.ocegr.fr X-Mailer: QUALCOMM Windows Eudora Version 4.3.1 Date: Thu, 11 May 2000 08:26:30 -0400 To: David Luyer From: Gert-Jan Vons Subject: Re: building rc on QNX4 Cc: rc@hawkwind.utcs.toronto.edu In-Reply-To: <20000509043420.2856.qmail@pantransit.reptiles.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed David Luyer wrote: >Basically some OS's (Digital Unix for one I think) have C libraries >which choke horribly if the size of the command line + environment array >is greater than a certain value, and if you have a number of complex >functions in your shell this value (64k?) can be a pain. For me "whatis |wc -c" returns 3308 bytes. However, I use a lot of lazy function loading, as has been talked about before on this list. In my .rcrc, I have: ># Lazy function (un)loading. ># >fnlib = $home/bin/rcfuncs >fn _ld { ~ $#* 1 && builtin . $fnlib/$1 } >fn _unld { ~ $#* 1 && fn $1 { _ld $0 && $0 $* }} > ># init all lazy functions by scanning the $fnlib directory >name = () for ( name in `{builtin cd $fnlib ; ls} ) _unld $name where my $home/bin/rcfuncs directory contains a number of files with rc function definitions (note that the file name must match the name of the function defined in it) So until I actually use my rc functions, for a lot of them there's only "fn somefunc {_ld $0&&$0 $*}" in my environment, which gets expanded to the real function the first time I call somefunc. And instead of re-reading my .rcrc file after every change to some function, I just do an "_unld newfunc", and the next time I call "newfunc", it is automatically reloaded from file. If your functions are really big, you could even unload them automatically after use. But in that case, turning those functions into rc shell scripts is probably simpler... Gert-Jan ----- "I have every sympathy with the American who was so horrified by what he had read about the effects of smoking that he gave up reading." - Henry G. Strauss From rc-owner Thu May 11 18:02:41 2000 Received: from bio.cse.psu.edu ([130.203.12.17]) by hawkwind.utcs.toronto.edu with SMTP id <25026>; Thu, 11 May 2000 16:54:42 -0400 Received: (qmail 7176 invoked by uid 991); 10 May 2000 00:37:09 -0000 Message-ID: <20000510003709.7174.qmail@g.bio.cse.psu.edu> to: rc@hawkwind.utcs.toronto.edu Subject: builtins In-Reply-To: Message from Stephen Tell of "Mon, 08 May 2000 19:25:25 EDT." Date: Tue, 9 May 2000 20:37:09 -0400 From: Scott Schwartz My $0.02: if you have echo as a builtin, read deserves the same. My other $0.02: echo needs a sibling builtin, quote, to enquote it's arguments so that they can be read by the shell. Lisp got that right ages ago. Inferno got it right more recently. Followups to the es list, I guess. :-) From rc-owner Sun May 14 01:40:35 2000 Received: from pantransit.reptiles.org ([209.157.133.146]) by hawkwind.utcs.toronto.edu with SMTP id <26168>; Sun, 14 May 2000 01:33:23 -0400 Received: (qmail 23615 invoked by uid 204); 12 May 2000 05:49:08 -0000 Date: Fri, 12 May 2000 01:49:08 -0400 Message-ID: <20000512054908.23614.qmail@pantransit.reptiles.org> From: "Smarasderagd" To: rc@hawkwind.utcs.toronto.edu, schwartz@bio.cse.psu.edu Subject: Re: builtins Scott Schwartz writes: >My $0.02: if you have echo as a builtin, read deserves the same. Should it honour escaped newlines the way Bourne shell read does? Wouldn't it be nice if you could read arrays? But what we really want is to generalize all of the hidden goo that reads input until we can reimplement the main loop as "while () {read a; eval $a}", and optionally also "echo $a >> $history", and a replacement for - and -- that lets you do structural editing... >My other $0.02: echo needs a sibling builtin, quote, to enquote it's >arguments so that they can be read by the shell. Lisp got that right ages >ago. Inferno got it right more recently. Oh, I guess that IS where you want to go. :) Seriously, I don't see any real reason why a quoting function doesn't make sense, since whatis already does this... From rc-owner Sun May 14 01:42:18 2000 Received: from fw.softwell.se ([193.15.236.45]) by hawkwind.utcs.toronto.edu with SMTP id <26181>; Sun, 14 May 2000 01:34:28 -0400 Received: from trillian.softwell.se (IDENT:bengt@trillian.softwell.se [192.42.172.11]) by fw.softwell.se (8.9.3/8.9.3) with ESMTP id MAA12218 for ; Fri, 12 May 2000 12:14:44 +0200 Received: (from bengt@localhost) by trillian.softwell.se (8.8.7/8.8.7) id MAA17928 for rc@hawkwind.utcs.utoronto.ca; Fri, 12 May 2000 12:14:43 +0200 Date: Fri, 12 May 2000 06:14:43 -0400 From: Bengt Kleberg Message-Id: <200005121014.MAA17928@trillian.softwell.se> To: rc@hawkwind.utcs.utoronto.ca Subject: ifs substitution, how should it work? Greetings, I thought that these two expression would produce different output ; x = ``( a b c ) {echo -n 1a2b3abc4} ; echo $x 1 2 3 4 and then x = ``( abc ) {echo -n 1a2b3abc4} ; echo $x 1 2 3 4 Obviously they do not, but since I was expecting 1a2b3 4 in the last case I wonder if this similarity is 'the real thing'? (i have failed utterly to understand the simple rc syntax before, so presumably I only need a friendly explanation as to why they must be the same :-) Best Wishes, Bengt =============================================================== Everything aforementioned should be regarded as totally private opinions, and nothing else. bengt@softwell.se ``His great strength is that he is uncompromising. It would make him physically ill to think of programming in C++.'' From rc-owner Sun May 14 01:42:33 2000 Received: from smtp1.libero.it ([193.70.192.51]) by hawkwind.utcs.toronto.edu with SMTP id <26172>; Sun, 14 May 2000 01:34:23 -0400 Received: from LocalHost (151.15.149.196) by smtp1.libero.it; 12 May 2000 09:40:40 +0200 Received: from carlos by localhost with local (Exim 2.05 #1 (Debian)) id 12q9mB-0000Mh-00; Fri, 12 May 2000 09:22:23 +0200 Date: Fri, 12 May 2000 03:22:23 -0400 From: Carlo Strozzi To: rc@hawkwind.utcs.toronto.edu Subject: Re: builtins Message-ID: <20000512092223.A1008@tango.libero.it> Reply-To: carlos@texne.com Mail-Followup-To: rc@hawkwind.utcs.toronto.edu References: <20000510003709.7174.qmail@g.bio.cse.psu.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <20000510003709.7174.qmail@g.bio.cse.psu.edu>; from schwartz@bio.cse.psu.edu on Tue, May 09, 2000 at 08:37:09PM -0400 Organization: TeXne.COM On Tue, May 09, 2000 at 08:37:09PM -0400, Scott Schwartz wrote: | My $0.02: if you have echo as a builtin, read deserves the same. I definitely agree. This is the single most important point IMHO. The prolem isn't just reading one single line fron stdin, as many unix utilities would allow that easily, but rather to make possible a construct like: { while ( read a ) echo $a } ; Tue, 16 May 2000 03:52:31 -0400 Received: from happy.star.le.ac.uk ([143.210.36.58]) by apollo.le.ac.uk with smtp (Exim 3.13 #2) id 12rH9n-0007Vk-00 for rc@hawkwind.utcs.toronto.edu; Mon, 15 May 2000 10:27:23 +0100 Received: (qmail 28887 invoked from network); 15 May 2000 09:27:41 -0000 Received: from ltpcg.star.le.ac.uk (tjg@143.210.36.203) by happy.star.le.ac.uk with SMTP; 15 May 2000 09:27:41 -0000 To: rc@hawkwind.utcs.toronto.edu In-Reply-To: <200005121014.MAA17928@trillian.softwell.se> Subject: Re: ifs substitution, how should it work? Date: Mon, 15 May 2000 05:27:17 -0400 From: Tim Goodwin Message-ID: > (i have failed utterly to understand the simple rc syntax before, so > presumably I only need a friendly explanation as to why they must be > the same :-) I bet you don't even need an explanation :-). What would you expect ; ifs=' ' to do (where `' represents a literal tab)? I don't know why Duff didn't make $ifs an rc list, but it remains in rc as it was in Bourne: a string treated as a list of individual characters. Tim. From rc-owner Wed May 17 17:08:20 2000 Received: from fw.softwell.se ([193.15.236.45]) by hawkwind.utcs.toronto.edu with SMTP id <26294>; Wed, 17 May 2000 16:54:15 -0400 Received: from trillian.softwell.se (IDENT:bengt@trillian.softwell.se [192.42.172.11]) by fw.softwell.se (8.9.3/8.9.3) with ESMTP id NAA20009; Tue, 16 May 2000 13:22:45 +0200 Received: (from bengt@localhost) by trillian.softwell.se (8.8.7/8.8.7) id NAA29930; Tue, 16 May 2000 13:22:45 +0200 Date: Tue, 16 May 2000 07:22:45 -0400 From: Bengt Kleberg Message-Id: <200005161122.NAA29930@trillian.softwell.se> To: rc@hawkwind.utcs.toronto.edu, tjg@star.le.ac.uk Subject: Re: ifs substitution, how should it work? Re: ifs substitution, how should it work? > What would you expect > ; ifs=(' ' '' ' ' > to do (where `' represents a literal tab)? I had but seen code with lists as ifs arguments, and therefore thought that rc was using lists. Ie, I would have written it as: ; ifs=(' ' '' ' ') Would it create much trouble to change rc :-) Best Wishes, Bengt =============================================================== Everything aforementioned should be regarded as totally private opinions, and nothing else. bengt@softwell.se ``His great strength is that he is uncompromising. It would make him physically ill to think of programming in C++.'' From rc-owner Fri May 19 18:02:25 2000 Received: from apollo.le.ac.uk ([143.210.16.125]) by hawkwind.utcs.toronto.edu with SMTP id <26328>; Fri, 19 May 2000 18:01:24 -0400 Received: from happy.star.le.ac.uk ([143.210.36.58]) by apollo.le.ac.uk with smtp (Exim 3.13 #2) id 12sPAO-0005Wn-00 for rc@hawkwind.utcs.toronto.edu; Thu, 18 May 2000 13:12:40 +0100 Received: (qmail 2788 invoked from network); 18 May 2000 12:13:01 -0000 Received: from ltpcg.star.le.ac.uk (tjg@143.210.36.203) by happy.star.le.ac.uk with SMTP; 18 May 2000 12:13:01 -0000 To: Bengt Kleberg CC: rc@hawkwind.utcs.toronto.edu In-Reply-To: <200005180812.KAA05394@trillian.softwell.se> Subject: Re: ifs substitution, how should it work? Date: Thu, 18 May 2000 08:12:38 -0400 From: Tim Goodwin Message-ID: > ; x = ``(abc) {echo -n 1a2b3abc4c5} > ; echo $x => 1a2b3 4c5 If you want awk, you know where to find it. :-) I don't think anything more complicated than single character field seperators belongs in a shell: particularly not rc. What's the actual problem you're trying to solve? Tim. From rc-owner Fri May 19 18:06:05 2000 Received: from fw.softwell.se ([193.15.236.45]) by hawkwind.utcs.toronto.edu with SMTP id <26338>; Fri, 19 May 2000 18:01:30 -0400 Received: from trillian.softwell.se (IDENT:bengt@trillian.softwell.se [192.42.172.11]) by fw.softwell.se (8.9.3/8.9.3) with ESMTP id OAA25413; Thu, 18 May 2000 14:57:31 +0200 Received: (from bengt@localhost) by trillian.softwell.se (8.8.7/8.8.7) id OAA06188; Thu, 18 May 2000 14:57:30 +0200 Date: Thu, 18 May 2000 08:57:30 -0400 From: Bengt Kleberg Message-Id: <200005181257.OAA06188@trillian.softwell.se> To: bengt@softwell.se, tjg@star.le.ac.uk Subject: Re: ifs substitution, how should it work? Cc: rc@hawkwind.utcs.toronto.edu > From: Tim Goodwin > > ; x = ``(abc) {cmd...} > > ; echo $x => 1a2b3 4c5 > If you want awk, you know where to find it. :-) Yes, but I had this little problem and suddenly realised that the mysterious ``(abc) {cmd...} actually might be used for something! I have never used it before. > I don't think anything more complicated than single character field > seperators belongs in a shell: particularly not rc. OK. Would you consider making ``(abc) a parse time error? only allow ifs=asd, or ifs=( a s d ), not ifs=(asd) too. Or, as with the confusing if ( {} && {} ) {cmd...} vs if ( () && () ) {cmd...} document it. > What's the actual problem you're trying to solve? split a filename into directory, filename and suffix. the suffix should be allowed to have more than 1 character. the idea is to make the previously emailed base_name function (made by Carlo Strozzi ) more like the os utility basename. Best Wishes, Bengt =============================================================== Everything aforementioned should be regarded as totally private opinions, and nothing else. bengt@softwell.se ``His great strength is that he is uncompromising. It would make him physically ill to think of programming in C++.'' From rc-owner Fri May 19 18:07:25 2000 Received: from proxy2.ba.best.com ([206.184.139.14]) by hawkwind.utcs.toronto.edu with SMTP id <26274>; Fri, 19 May 2000 18:00:20 -0400 Received: from rakitzis.com ([207.20.242.213]) by proxy2.ba.best.com (8.9.3/8.9.2/best.out) with ESMTP id XAA13172; Wed, 17 May 2000 23:33:45 -0700 (PDT) Received: (from byron@localhost) by rakitzis.com (8.9.3/8.9.3) id XAA22341; Wed, 17 May 2000 23:32:57 -0700 Date: Thu, 18 May 2000 02:32:57 -0400 From: Byron Rakitzis Message-Id: <200005180632.XAA22341@rakitzis.com> To: bengt@softwell.se, rc@hawkwind.utcs.toronto.edu, tjg@star.le.ac.uk Subject: Re: ifs substitution, how should it work? > From: Bengt Kleberg > Subject: Re: ifs substitution, how should it work? > > Re: ifs substitution, how should it work? > > > What would you expect > > > ; ifs=(' ' '' ' > ' > > > to do (where `' represents a literal tab)? > > > I had but seen code with lists as ifs arguments, and therefore thought > that rc was using lists. > Ie, I would have written it as: > > ; ifs=(' ' '' ' > ') > > Would it create much trouble to change rc :-) I am not sure what the problem is... At the moment rc scans ifs as a list and as a sequence of characters. i.e., the implementation is as follows: [from glom.c:bqinput] memzero(isifs, sizeof isifs); for (isifs['\0'] = TRUE; ifs != NULL; ifs = ifs->n) for (s = ifs->w; *s != '\0'; s++) isifs[*(unsigned char *)s] = TRUE; So, ifs='abc' and ifs=(a b c) should accomplish the same thing. Isn't that what you want? Byron. From rc-owner Fri May 19 18:07:30 2000 Received: from fw.softwell.se ([193.15.236.45]) by hawkwind.utcs.toronto.edu with SMTP id <26311>; Fri, 19 May 2000 18:01:18 -0400 Received: from trillian.softwell.se (IDENT:bengt@trillian.softwell.se [192.42.172.11]) by fw.softwell.se (8.9.3/8.9.3) with ESMTP id KAA24979; Thu, 18 May 2000 10:12:54 +0200 Received: (from bengt@localhost) by trillian.softwell.se (8.8.7/8.8.7) id KAA05394; Thu, 18 May 2000 10:12:53 +0200 Date: Thu, 18 May 2000 04:12:53 -0400 From: Bengt Kleberg Message-Id: <200005180812.KAA05394@trillian.softwell.se> To: bengt@softwell.se, byron@rakitzis.com, rc@hawkwind.utcs.toronto.edu, tjg@star.le.ac.uk Subject: Re: ifs substitution, how should it work? > From: Byron Rakitzis > So, > ifs='abc' > and > ifs=(a b c) > should accomplish the same thing. > Isn't that what you want? No. I wanted ifs = (abc) Ie, ; x = ``(abc) {echo -n 1a2b3abc4c5} ; echo $x => 1a2b3 4c5 This is (IMHO) better, but I presume that there is too much code out there that depends upon ifs='abc' beeing equal to ifs=(abc). What if I volunteered to fix everybody elses code for them (provided that they send it to me :-) Best Wishes, Bengt =============================================================== Everything aforementioned should be regarded as totally private opinions, and nothing else. bengt@softwell.se ``His great strength is that he is uncompromising. It would make him physically ill to think of programming in C++.'' From rc-owner Sun May 21 01:29:35 2000 Received: from plan9.cs.bell-labs.com ([204.178.31.2]) by hawkwind.utcs.toronto.edu with SMTP id <26277>; Sun, 21 May 2000 00:42:30 -0400 From: "Russ Cox" Date: Fri, 19 May 2000 18:10:01 -0400 To: rc@hawkwind.utcs.toronto.edu, tjg@star.le.ac.uk Subject: Re: ifs substitution, how should it work? MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Message-Id: <00May21.004230edt.26277@hawkwind.utcs.toronto.edu> Introducing contexts where singleton lists and strings are not identical seems a very bad idea. Then you have to explain that in general they are but ifs isn't; and what if save ifs away to another variable and then restore it? What does "x=(abc); ifs=$x" do? If you want basename, why not use basename or sed or awk? Russ From rc-owner Tue May 23 19:56:07 2000 Received: from apollo.le.ac.uk ([143.210.16.125]) by hawkwind.utcs.toronto.edu with SMTP id <26473>; Tue, 23 May 2000 19:01:29 -0400 Received: from happy.star.le.ac.uk ([143.210.36.58]) by apollo.le.ac.uk with smtp (Exim 3.13 #2) id 12tnxP-0000R9-00 for rc@hawkwind.utcs.toronto.edu; Mon, 22 May 2000 09:53:03 +0100 Received: (qmail 8574 invoked from network); 22 May 2000 08:53:24 -0000 Received: from ltpcg.star.le.ac.uk (tjg@143.210.36.203) by happy.star.le.ac.uk with SMTP; 22 May 2000 08:53:24 -0000 To: rc@hawkwind.utcs.toronto.edu In-Reply-To: <200005220755.JAA01026@trillian.softwell.se> Subject: Re: ifs substitution, how should it work? Date: Mon, 22 May 2000 04:53:01 -0400 From: Tim Goodwin Message-ID: > i wanted > x = asd > and > y = (asd) > to mean that x and y where not identical. No, no, no. There is just one data type in rc: a list of strings. You might sometimes think you've got a string, but you haven't: you've got a list with one element. Now, when ifs is used, the list of strings that it holds is interpreted as a set of characters. I agree with you that the documentation should be a bit clearer on this point: the man page doesn't seem to mention anywhere what happens when ifs is a more-than-one element list. Tim. From rc-owner Tue May 23 19:56:22 2000 Received: from fw.softwell.se ([193.15.236.45]) by hawkwind.utcs.toronto.edu with SMTP id <26464>; Tue, 23 May 2000 19:00:29 -0400 Received: from trillian.softwell.se (IDENT:bengt@trillian.softwell.se [192.42.172.11]) by fw.softwell.se (8.9.3/8.9.3) with ESMTP id JAA31983; Mon, 22 May 2000 09:55:23 +0200 Received: (from bengt@localhost) by trillian.softwell.se (8.8.7/8.8.7) id JAA01026; Mon, 22 May 2000 09:55:23 +0200 Date: Mon, 22 May 2000 03:55:23 -0400 From: Bengt Kleberg Message-Id: <200005220755.JAA01026@trillian.softwell.se> To: rc@hawkwind.utcs.toronto.edu, rsc@plan9.bell-labs.com, tjg@star.le.ac.uk Subject: Re: ifs substitution, how should it work? > From: "Russ Cox" > Introducing contexts where singleton lists > and strings are not identical seems a very bad idea. I agree about the context bit. ie, lists and strings should be (or not be) identical in all contexts. it is just that I thought that they should not be identical. i wanted x = asd and y = (asd) to mean that x and y where not identical. Best Wishes, Bengt =============================================================== Everything aforementioned should be regarded as totally private opinions, and nothing else. bengt@softwell.se ``His great strength is that he is uncompromising. It would make him physically ill to think of programming in C++.'' From rc-owner Thu Jun 8 00:58:42 2000 Received: from smtp3.libero.it ([193.70.192.53]) by hawkwind.utcs.toronto.edu with SMTP id <28499>; Thu, 8 Jun 2000 00:47:52 -0400 Received: from LocalHost (151.15.154.27) by smtp3.libero.it; 7 Jun 2000 09:34:41 +0200 Received: from carlos by localhost with local (Exim 2.05 #1 (Debian)) id 12zZit-000170-00; Wed, 7 Jun 2000 08:53:55 +0200 To: rc@hawkwind.utcs.toronto.edu Subject: environment again Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 X-Mailer: mailx v8.1.1 ;-) Reply-To: carlos@texne.com Organization: TeXne.COM Message-Id: From: Carlo Strozzi Date: Wed, 7 Jun 2000 02:53:55 -0400 Hi all, a few weeks back I started a thread on the fact that rc should provide a way of not exporting variables to the environment. There seemed to be a general position that the current behaviour is ok. I think it isn't, though: ; ls -l bigfile -rw-r--r-- 1 carlos carlos 660226 May 8 14:13 bigfile ; a=`{cat bigfile} ; echo $a |wc -c wc: Argument list too long Any command after that fails with the same message, presumably because of the bloated environment. That was tested on AIX and Linux. I have tested it also with a=``(){cat bigfile}, if that matters. Doing the same with ksh: $ a="`cat bigfile`" echo "$a" | wc -c 660226 $ So no problem, so far. Then: $ export a $ /bin/echo x ksh: /bin/echo: Argument list too long Again, a bloated environment does give problems, but the fact that ksh does not export things by default is a plus here. "Well, why don't you just use ksh then?" some of you may say. Because I rather like the philosophy behind rc, I just would like it not to have those very few defects. If I were a C programmer I would try to fix it myself, but even so I would need to convince the rc people if I wanted to have those changes included into the mainstram code. As a final note, making rc swallow a large file all in one go would not be necessary if it had a 'read' function, for line-oriented input, which was the other thread of mine on this list. --carlo From rc-owner Fri Jun 9 04:44:11 2000 Received: from mail.rdc1.ct.home.com ([24.2.0.66]) by hawkwind.utcs.toronto.edu with SMTP id <28503>; Fri, 9 Jun 2000 04:33:58 -0400 Received: from c26469-a.clnvl1.ct.home.com ([24.2.177.105]) by mail.rdc1.ct.home.com (InterMail vM.4.01.02.00 201-229-116) with SMTP id <20000608055521.JHJK6851.mail.rdc1.ct.home.com@c26469-a.clnvl1.ct.home.com>; Wed, 7 Jun 2000 22:55:21 -0700 Received: by c26469-a.clnvl1.ct.home.com (sSMTP sendmail emulation); Thu, 8 Jun 2000 01:55:31 -0400 Date: Thu, 8 Jun 2000 01:55:31 -0400 From: "Decklin Foster" To: carlos@texne.com Cc: rc@hawkwind.utcs.toronto.edu Subject: Re: environment again Message-ID: <20000608015531.A9424@c26469-a.clnvl1.ct.home.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: ; from carlos@linux.it on Wed, Jun 07, 2000 at 02:53:55AM -0400 Organization: Society for the Prevention of Cruelty to Vermin Carlo Strozzi writes: > ; a=`{cat bigfile} > ; echo $a |wc -c Can you give a non-trivial example? This should be 'wc -c < bigfile', obviously; I'm wondering what the real problem you're working on is where you can't iron out the variable. I'd tenatively say that I think a shell should provide you with enough facilites not to have to ever make variables that big, but you might come back at me with a doozy... -- There is no TRUTH. There is no REALITY. There is no CONSISTENCY. There are no ABSOLUTE STATEMENTS. I'm very probably wrong. -- BSD fortune(6) From rc-owner Fri Jun 9 04:44:48 2000 Received: from janus.ocegr.fr ([194.3.183.34]) by hawkwind.utcs.toronto.edu with SMTP id <28592>; Fri, 9 Jun 2000 04:35:10 -0400 Received: (qmail 22152 invoked from network); 8 Jun 2000 07:31:46 -0000 Received: from hydra.ocegr.fr (HELO ocegr.fr) (134.188.135.3) by janus.ocegr.fr with SMTP; 8 Jun 2000 07:31:46 -0000 Received: from alcina.ocegr.fr (alcina.ocegr.fr [134.188.136.183]) by ocegr.fr (8.8.8+Sun/8.8.8) with ESMTP id JAA22647 for ; Thu, 8 Jun 2000 09:38:41 +0200 (MET DST) Message-Id: <4.3.2.7.2.20000608092932.00b2d490@mailhost.ocegr.fr> X-Sender: vons@mailhost.ocegr.fr X-Mailer: QUALCOMM Windows Eudora Version 4.3.2 Date: Thu, 8 Jun 2000 03:38:37 -0400 To: rc@hawkwind.utcs.toronto.edu From: Gert-Jan Vons Subject: Bell Labs Unveils Open Source Release of Plan 9(TM) Operating System Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Don't know if you've all heard about this announcement from Bell Labs; see their press release for more info http://www.bell-labs.com/news/2000/june/7/2.html Gert-Jan ----- Murphy's Second Law: Everything takes longer than you think. From rc-owner Fri Jun 9 04:44:59 2000 Received: from smtp3.libero.it ([193.70.192.53]) by hawkwind.utcs.toronto.edu with SMTP id <28589>; Fri, 9 Jun 2000 04:35:03 -0400 Received: from LocalHost (151.15.148.208) by smtp3.libero.it; 8 Jun 2000 09:20:24 +0200 Received: from carlos by localhost with local (Exim 2.05 #1 (Debian)) id 12zway-0000Ko-00; Thu, 8 Jun 2000 09:19:16 +0200 To: fosterd@hartwick.edu Subject: Re: environment again Cc: rc@hawkwind.utcs.toronto.edu Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 X-Mailer: mailx v8.1.1 ;-) Reply-To: carlos@texne.com Organization: TeXne.COM Message-Id: From: Carlo Strozzi Date: Thu, 8 Jun 2000 03:19:16 -0400 Decklin Foster wrote: | > ; a=`{cat bigfile} | > ; echo $a |wc -c | | Can you give a non-trivial example? This should be 'wc -c < bigfile', | obviously; I'm wondering what the real problem you're working on is | where you can't iron out the variable. Oh, yes, of course that was just an example, but it is meant to show that bloating the environment is bad. On the other hand, given the fact that rc does not provide a 'read' builtin, I cannot really devise how to do to process a file line-by-line other than swallowing it into memory all in one go and then using $*(n) to reference each line in turn. The point is that I use the shell to build the outer layer of relatively large and complex Web applications. You may argue that I should resort to a different language, but I would disagree. When it comes to delivering applications in virtually no time, nothing beats the shell. I have usually used bourne-type shells for this, but now that I know of rc I really like it and I would like to switch. Now, this leads to the next, much more practical example of real-world problem that may lead to a bloated environment with rc: Suppose you want to build a Web search engine like Altavista (not that I built that particular one :-), that will show the results on the output page in chunks of ten at a time. To render the results I am using a web page template, that contains a special tag that marks the point in the page where I want the final result to appare. This is usually in the body of an html table, where each table row is one search hit (like Altavista). Unlike Altavista though, suppose that the output contains the complete hits, not just absracts of them. As you know, you can put such html structure with all of its formatting tags all on one single line, as the final rendering will not depend on physical newlines but rather on the html tags themselves. Furthermore each output hit can contain other hyperlinks, embedded images, formatting tags and so on, so the shell variable that is going to hold it may become pretty large. Then say I want to use sed(1) to substitute the special tag in the page template with such a result string, I need to do something like: sed 's/__SPECIAL_TAG__/'^$my_big_var'/' page_template.html which will send the final output to stdout, i.e. to the Web client Of course I must also provide for escaping any sed(1) special characters in $my_big_var, so I need to make that variable known to the shell for all this back-and-forth between different utilities (that's what the shell is supposed to be: the "glue" between utilities). Although not easily, I could use an external file rather than $my_big_var, and use 'sed -f', but that would require a few more i/o operations in the CGI program. If the site handles a couple of million hits a day I would really like to avoid that. Back to the possibility that you suggest I should resort to a different language for such things, apart from fast go-to-market considerations a can demonstrate that a lightweight shell + well-choosen utilities can provide a faster application than other self-contained approaches (there are books on that). Unless you want to re-code the whole system into your application, the very few times you will run an external utility (like sendmail(8) for instance) you will need a system(3), which will run a shell (possibly bash(1), which is ten time slower than rc), so you had better just to use the shell in the first place. Sorry for the length, but I think that explaining things works better than posting a few lines of obscure code :-) As I said I'm awful at C, but is it really that difficult to provide a way for not exporting everything to the environment by default ? I think it would simply make rc a better interpreter. Take care --carlo From rc-owner Fri Jun 9 04:45:08 2000 Received: from mail.rdc1.ct.home.com ([24.2.0.66]) by hawkwind.utcs.toronto.edu with SMTP id <28637>; Fri, 9 Jun 2000 04:35:15 -0400 Received: from c26469-a.clnvl1.ct.home.com ([24.2.177.105]) by mail.rdc1.ct.home.com (InterMail vM.4.01.02.00 201-229-116) with SMTP id <20000608164822.QNLR6851.mail.rdc1.ct.home.com@c26469-a.clnvl1.ct.home.com>; Thu, 8 Jun 2000 09:48:22 -0700 Received: by c26469-a.clnvl1.ct.home.com (sSMTP sendmail emulation); Thu, 8 Jun 2000 12:48:37 -0400 Date: Thu, 8 Jun 2000 12:48:37 -0400 From: "Decklin Foster" To: carlos@texne.com Cc: rc@hawkwind.utcs.toronto.edu Subject: Re: environment again Message-ID: <20000608124837.A10730@c26469-a.clnvl1.ct.home.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: ; from carlos@linux.it on Thu, Jun 08, 2000 at 09:19:16AM +0200 Organization: Society for the Prevention of Cruelty to Vermin Carlo Strozzi writes: > sed 's/__SPECIAL_TAG__/'^$my_big_var'/' page_template.html OK, but where is $my_big_var set? That's what I need to know to figure out how to write it without the variable. > Back to the possibility that you suggest I should resort to a different > language for such things, I didn't say that ;-) > you will need a system(3), Feh. fork/exec. But that's totally off-topic, so nevermind. -- There is no TRUTH. There is no REALITY. There is no CONSISTENCY. There are no ABSOLUTE STATEMENTS. I'm very probably wrong. -- BSD fortune(6) From rc-owner Fri Jun 9 04:45:22 2000 Received: from smtp1.libero.it ([193.70.192.51]) by hawkwind.utcs.toronto.edu with SMTP id <28679>; Fri, 9 Jun 2000 04:35:21 -0400 Received: from LocalHost (151.15.133.179) by smtp1.libero.it; 8 Jun 2000 21:38:54 +0200 Received: from carlos by localhost with local (Exim 2.05 #1 (Debian)) id 1307Zs-0001R0-00; Thu, 8 Jun 2000 21:02:52 +0200 To: fosterd@hartwick.edu Subject: Re: environment again Cc: rc@hawkwind.utcs.toronto.edu Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 X-Mailer: mailx v8.1.1 ;-) Reply-To: carlos@texne.com Organization: TeXne.COM Message-Id: From: Carlo Strozzi Date: Thu, 8 Jun 2000 15:02:52 -0400 Decklin Foster wrote: | Carlo Strozzi writes: | | > sed 's/__SPECIAL_TAG__/'^$my_big_var'/' page_template.html | | OK, but where is $my_big_var set? That's what I need to know to figure | out how to write it without the variable. Hmm .. ok, I'll try and provide a reasonably simple example. I often use flat-file ascii tables with the following sample structure: ; cat mytable Col1 Col2 Col3 ---- ---- ---- data1 data2 some-big-data where the data parts may contain stuff that "bytes", especially if exposed to an 'eval' statement. Then suppose I need to use data1 and data2 in several places in my shell script, and some-big-data needs to be passed to sed(1) for substitution on the output page template (as per my previous message). Furthermore, all this needs to be done with the least possible No. of processes, as we are talking about high traffic web sites. All the above can actually be done in one single call to awk, like this: eval `{awk 'awk program' mytable} where 'awk program' is supposed to: 1) escape sed(1) special chars in some-big-data 2) further escape shell special chars in all the data parts 3) return the following fragment of rc code: { Col1='data1'; Col2='data2'; Col3='some-big-data' } This makes it possible to eval awk's output and grab the results back into the calling shell script for later use, for instance in the aforementioned statement: sed 's/__SPECIAL_TAG__/'^$Col3'/' page_template.html Of course one way out could be to have 'awk program' only return { Col1='data1'; Col2='data2' } while writing the sed(1) statement 's/__SPECIAL_TAG__/some-big-data/' to a temporary file, to be later used as: sed -f tmpfile page_template.html This would cost us: - one more i/o from awk to write tmpfile - one more i/o for sed to read tmpfile - one more rm(1) process to remove tmpfile on exit which multiplied by the two-million times our CGI gets hit every day ... :-) Furthermore, 'awk program' would be less general as it would need to treat some-big-data differently from data1/data2. | > you will need a system(3), | | Feh. fork/exec. But that's totally off-topic, so nevermind. Oh, I wasn't talking about C, but rather PHP or other mainstream interpreted languages for CGI scripting, or even awk, that whatever external program it needs to run it calls it with '/bin/sh -c'. This is true at least with mawk/gawk. bye --carlo From rc-owner Tue Jun 13 18:21:49 2000 Received: from apollo.le.ac.uk ([143.210.16.125]) by hawkwind.utcs.toronto.edu with SMTP id <28918>; Tue, 13 Jun 2000 17:34:49 -0400 Received: from happy.star.le.ac.uk ([143.210.36.58]) by apollo.le.ac.uk with smtp (Exim 3.13 #2) id 131W4C-0005ih-00 for rc@hawkwind.utcs.toronto.edu; Mon, 12 Jun 2000 16:23:56 +0100 Received: (qmail 16629 invoked from network); 12 Jun 2000 15:24:18 -0000 Received: from ltpcg.star.le.ac.uk (tjg@143.210.36.203) by happy.star.le.ac.uk with SMTP; 12 Jun 2000 15:24:18 -0000 Subject: Re: environment again To: carlos@texne.com Cc: rc@hawkwind.utcs.toronto.edu In-Reply-To: Date: Mon, 12 Jun 2000 11:23:55 -0400 From: Tim Goodwin Message-ID: <4AcAAKEARTmN4wYA@ltsun0.star.le.ac.uk> > { Col1='data1'; Col2='data2'; Col3='some-big-data' } > [...] > sed 's/__SPECIAL_TAG__/'^$Col3'/' page_template.html What's the problem with simply doing this? Is Col3 so enormous that you're running into environment variable limits? Or are you worried about performance? If it's performance, "profile, don't speculate!" It would be very interesting to see some test results showing just how much it costs to have some enormous variables in the environment. Finally, if I've understood correctly what you're trying to achieve, there is a workaround, although it's rather ugly. eval 'Col3=() sed s/__SPECIAL_TAG__/'^$Col3^'/ page_template.html' Tim. From rc-owner Tue Jun 13 18:22:53 2000 Received: from smtp1.libero.it ([193.70.192.51]) by hawkwind.utcs.toronto.edu with SMTP id <28923>; Tue, 13 Jun 2000 17:35:55 -0400 Received: from localhost (151.15.134.17) by smtp1.libero.it; 12 Jun 2000 18:37:03 +0200 Received: from carlos by localhost with local (Exim 2.05 #1 (Debian)) id 131XBA-0005jG-00; Mon, 12 Jun 2000 18:35:12 +0200 Date: Mon, 12 Jun 2000 12:35:12 -0400 From: Carlo Strozzi To: Tim Goodwin Cc: rc@hawkwind.utcs.toronto.edu Subject: Re: environment again Message-ID: <20000612183512.F20497@tango.texne.com> Reply-To: carlos@texne.com Mail-Followup-To: Tim Goodwin , rc@hawkwind.utcs.toronto.edu References: <4AcAAKEARTmN4wYA@ltsun0.star.le.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <4AcAAKEARTmN4wYA@ltsun0.star.le.ac.uk>; from tjg@star.le.ac.uk on Mon, Jun 12, 2000 at 04:23:55PM +0100 Organization: TeXne.COM On Mon, Jun 12, 2000 at 04:23:55PM +0100, Tim Goodwin wrote: | > { Col1='data1'; Col2='data2'; Col3='some-big-data' } | > [...] | > sed 's/__SPECIAL_TAG__/'^$Col3'/' page_template.html | | What's the problem with simply doing this? Is Col3 so enormous that | you're running into environment variable limits? Or are you worried | about performance? No, it is the former, i.e. size. Again, I'm not a C programmer but I noticed that with ksh(1) if a keep a large variable local it works fine, while exporting it to the environment produces the same problem that I get with rc(1), as I showed in my original posting on this thread. Anyway, having huge shell variables may indeed not be a good idea. That very thing (combined with the fact that is seems really hard to get you rc guys to change anything of that shell :-)) suggests that it is probably better to write such data out to a temporary file and handle it differently. | Finally, if I've understood correctly what you're trying to achieve, | there is a workaround, although it's rather ugly. | | eval 'Col3=() sed s/__SPECIAL_TAG__/'^$Col3^'/ page_template.html' Hmm ... wouldn't the following be equivalent ? Col3=() { sed 's/__SPECIAL_TAG__/'^$Col3^'/' page_template.html } bye --carlo -- I can read MIME or uuencoded e-mail attachments in PDF, Postscript, HTML, RTF or text formats. Please do not send Word, Excel or PowerPoint files. From rc-owner Mon Jul 10 15:55:48 2000 Received: from mail.rdc1.ct.home.com ([24.2.0.66]) by hawkwind.utcs.utoronto.ca with SMTP id <44201>; Mon, 10 Jul 2000 15:28:23 -0500 Received: from c26469-a.clnvl1.ct.home.com ([24.2.177.105]) by mail.rdc1.ct.home.com (InterMail vM.4.01.03.00 201-229-121) with SMTP id <20000708014909.XWYL3097.mail.rdc1.ct.home.com@c26469-a.clnvl1.ct.home.com> for ; Fri, 7 Jul 2000 18:49:09 -0700 Received: by c26469-a.clnvl1.ct.home.com (sSMTP sendmail emulation); Fri, 7 Jul 2000 21:50:38 +4400 Date: Fri, 7 Jul 2000 21:50:38 -0500 From: "Decklin Foster" To: rc@hawkwind.utcs.toronto.edu Subject: flattening a command substitution Message-ID: <20000707215038.A5353@c26469-a.clnvl1.ct.home.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i Organization: Society for the Prevention of Cruelty to Vermin Is there a way to perform a command substitution and flatten it all at once? For example, say I want to work with a pwd that has spaces: ; pwd /home/decklin ; mkdir 'foo bar' ; cd 'foo bar' ; ls `{pwd} ls: /home/decklin/foo: No such file or directory ls: bar: No such file or directory [nonzero status 1] ; ls ``(){pwd} ls: /home/decklin/foo bar : No such file or directory [nonzero status 1] ; Now, there are two ways I can get it to work: use a newline as the ifs-value, or have a temporary variable: pwd=`{pwd} ls $^pwd Neither strike me as being very elegant. The first option doesn't generalize to commands with multi-line output, and having to waste a variable seems wrong. Does anyone have a better idea? -- There is no TRUTH. There is no REALITY. There is no CONSISTENCY. There are no ABSOLUTE STATEMENTS. I'm very probably wrong. -- BSD fortune(6) From rc-owner Wed Jul 12 17:58:20 2000 Received: from pantransit.reptiles.org ([209.157.133.146]) by hawkwind.utcs.utoronto.ca with SMTP id <44232>; Wed, 12 Jul 2000 17:54:10 -0500 Received: (qmail 21963 invoked by uid 204); 11 Jul 2000 16:39:49 -0000 Date: Tue, 11 Jul 2000 12:39:49 -0500 Message-ID: <20000711163949.21962.qmail@pantransit.reptiles.org> From: "Smarasderagd" To: fosterd@hartwick.edu, rc@hawkwind.utcs.toronto.edu Subject: Re: flattening a command substitution "Decklin Foster" writes: >Is there a way to perform a command substitution and flatten it all at >once? For example, say I want to work with a pwd that has spaces: Or worse, tabs. >Now, there are two ways I can get it to work: use a newline as the >ifs-value, or have a temporary variable: > >pwd=`{pwd} >ls $^pwd I usually do: nl = ' ' somewhere at the top of the script. I sometimes also have tab = ' '. Later, if I want to ignore other whitespace: ls ``($nl){pwd} >Neither strike me as being very elegant. The first option doesn't >generalize to commands with multi-line output, and having to waste a >variable seems wrong. Does anyone have a better idea? For commands with multi-line output, ``(){command} seems like the right thing to me. As others may have discovered, it still splits the output if it happens to contain nulls, which I actually find rather useful if I want to do things with the output of find with the -print0 option... From rc-owner Mon Aug 14 15:22:43 2000 Received: from apollo.le.ac.uk ([143.210.16.125]) by hawkwind.utcs.utoronto.ca with SMTP id <44210>; Mon, 14 Aug 2000 15:14:21 -0500 Received: from happy.star.le.ac.uk ([143.210.36.58]) by apollo.le.ac.uk with smtp (Exim 3.13 #2) id 13NERK-00033t-00 for rc@hawkwind.utcs.utoronto.ca; Fri, 11 Aug 2000 14:01:34 +0100 Received: (qmail 28345 invoked from network); 11 Aug 2000 13:01:56 -0000 Received: from ltpcg.star.le.ac.uk (tjg@143.210.36.203) by happy.star.le.ac.uk with SMTP; 11 Aug 2000 13:01:56 -0000 To: rc@hawkwind.utcs.utoronto.ca Subject: New rc snapshot, includes "the equals hack" Date: Fri, 11 Aug 2000 09:01:32 -0500 From: Tim Goodwin Message-ID: A new, and possibly controversial, rc development snapshot is available from the usual place. http://www.star.le.ac.uk/~tjg/rc/snap/rc-1.6s20000811.tar.gz There are a few minor bug fixes, and the addition of the `-I' flag from the Plan9 rc (the opposite of `-i': this shell is definitely not interactive). See the full list of changes since the last beta at the end of this message. In addition, this snapshot includes a cunning patch by Thomas Nordin that permits `=' to appear, unquoted, outside assignments. For ease of reference, I'm calling this "the equals hack", where the word "hack" is not intended to have any pejorative connotations... The equals hack, which in fact was just a one line addition to the grammar, effectively makes `=' stand for `^'='^' (when it's not an assignment). The slightly surprising feature of this is that `=' swallows whitespace around it. ; echo a = b a=b Apart from that, everything works as you would expect. ; dd if=/etc/group |wc 1+1 records in 1+1 records out 44 44 780 ; sh configure --prefix=/local [...] ; a=b=c b=c echo $a $b b=c c (All these were previously syntax errors. The equals hack doesn't change the meaning of anything that was previously legal.) What do you think? Should the equals hack stay? Tim. 2000-04-19 Bug: isatty() tests in input.c are relevant to any fd, not just 0. Now `. -i /dev/tty' works right. Bug: fn sigexit wasn't always cleared in child shells. Bug: `~ () '*'' dumped core. 2000-05-25 Portability: need special runes for read() returning EIO under job control systems. 2000-06-20 Feature: add `-I' flag (definitively not interactive) for compatibility with Plan 9 rc. 2000-07-27 Feature: the "equals hack". From rc-owner Tue Aug 15 01:50:04 2000 Received: from lorax.myhouse.org ([63.79.38.134]) by hawkwind.utcs.utoronto.ca with SMTP id <44227>; Tue, 15 Aug 2000 01:49:33 -0500 Received: from mail.wirefire.com (gary@localhost) by lorax.myhouse.org (8.10.2/8.10.2) id e7F3LmI01411; Mon, 14 Aug 2000 23:21:48 -0400 Date: Mon, 14 Aug 2000 23:21:48 -0500 From: Gary Carvell To: Tim Goodwin Cc: rc@hawkwind.utcs.toronto.edu Subject: Re: New rc snapshot, includes "the equals hack" Message-ID: <20000814232148.A1027@lorax.wirefire.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from tjg@star.le.ac.uk on Fri, Aug 11, 2000 at 09:01:32AM -0500 On Fri, Aug 11, 2000 at 09:01:32AM -0500, Tim Goodwin wrote: > What do you think? Should the equals hack stay? > > Tim. Yes! Yes! Yes! Keep it!!! (Sorry :-) I will be downloading the snapshot ASAP to try this out. Your two examples, dd and configure, are in fact the only times I ever drop into sh - just can't stand typing all those quotes for all the command line arguments. It may be a tiny hack, but a definite big usability win. Gary -- Gary Carvell gcarvell@wirefire.com From rc-owner Tue Aug 15 01:50:08 2000 Received: from susankarp.com ([63.203.198.9]) by hawkwind.utcs.utoronto.ca with SMTP id <44225>; Tue, 15 Aug 2000 01:49:21 -0500 Received: (from haahr@localhost) by susankarp.com (8.8.7/8.8.7) id SAA28008; Mon, 14 Aug 2000 18:21:35 -0700 X-Authentication-Warning: iadd.jivetech.com: haahr set sender to haahr@jivetech.com using -f From: Paul Haahr X-Attribution: haahr Message-Id: Date: Mon, 14 Aug 2000 21:21:35 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: Tim Goodwin Cc: rc@hawkwind.utcs.toronto.edu Subject: Re: New rc snapshot, includes "the equals hack" In-Reply-To: References: X-Mailer: VM 6.30 under Emacs 20.3.1 > What do you think? Should the equals hack stay? Yes. (I'll try to add it to es in the near future.) Back when Byron wrote rc (and I wrote es) there was nary a command which took '=' as its argument. dd was the most popular, if I remember. But, these days, all sorts of commands take long options with = instead of spaces as the argument separator. Blame it on GNU. :-) --p From rc-owner Tue Aug 15 01:50:14 2000 Received: from proxy4.ba.best.com ([206.184.139.15]) by hawkwind.utcs.utoronto.ca with SMTP id <44234>; Tue, 15 Aug 2000 01:49:33 -0500 Received: from rakitzis.com ([207.20.242.213]) by proxy4.ba.best.com (8.9.3/8.9.2/best.out) with ESMTP id WAA12721; Mon, 14 Aug 2000 22:42:36 -0700 (PDT) Received: (from byron@localhost) by rakitzis.com (8.9.3/8.9.3) id WAA10934; Mon, 14 Aug 2000 22:41:52 -0700 Date: Tue, 15 Aug 2000 01:41:52 -0500 From: Byron Rakitzis Message-Id: <200008150541.WAA10934@rakitzis.com> To: rc@hawkwind.utcs.toronto.edu, tjg@star.le.ac.uk Subject: Re: New rc snapshot, includes "the equals hack" Paul and I sought an "equals hack" back in 1992 or so but for some reason we were unable to come up with something clean. The "equals hack" solves the "dd bug" and the "make bug" which are the two most frequent uses of equals sign on the command line, at least for me. As for the unexpected gluing of = to its neighbors, I suppose that is the lesser evil -- rc already has this notion of "free carets" so it's a bug which at least makes sense in that context. I think what prevented me from doing this a while ago is that I was trying to fix lexing of '=' in the lexical analyzer: this would have made the scanning of '=' context-sensitive and it would avoid the unexpected behavior of free-careting '=' to its neighbors. But, after some effort I wasn't able to get this to work in a satisfactory way. It certainly wasn't a one-line fix. I don't know, what do other people think? In practical use, I can't see that the equals hack is a bad thing. You could always separate out the equals by quoting: echo a '=' b Of course, the equals hack also has some non-obvious side-effects: ; echo a= syntax error ; echo a== syntax error ; echo a==b syntax error ; One thing is for sure, it's a hack... Byron. From rc-owner Tue Aug 15 15:16:03 2000 Received: from asimov.lanl.gov ([128.165.128.100]) by hawkwind.utcs.utoronto.ca with SMTP id <44201>; Tue, 15 Aug 2000 15:15:58 -0500 Received: from asimov.lanl.gov (mkg@localhost) by asimov.lanl.gov (8.9.3/8.9.3) with ESMTP id HAA24045; Tue, 15 Aug 2000 07:52:12 -0600 Message-Id: <200008151352.HAA24045@asimov.lanl.gov> To: rc@hawkwind.utcs.toronto.edu cc: Tim Goodwin Subject: Re: New rc snapshot, includes "the equals hack" In-Reply-To: Your message of "Fri, 11 Aug 2000 09:01:32 CDT." Date: Tue, 15 Aug 2000 09:52:12 -0500 From: "Mark K. Gardner" On Friday, 11 Aug 2000 Tim Goodwin said: > What do you think? Should the equals hack stay? YES! This fixes one of the few remaining things in rc that has caused me grief and although I have gotten used to quoting the arguments to FSF tools, e.g., autoconfig generated configure scripts, I would prefer not to do it. By all means keep it. Mark -- Mark K. Gardner RADIANT Team Network Engineering, CIC-5 Los Alamos National Laboratory P.O. Box 1663, M.S. D451 Los Alamos, NM 87545 Email: mkg@lanl.gov Phone: 1-505-665-4953 -- From rc-owner Tue Aug 15 15:16:08 2000 Received: from cesium.clock.org ([209.179.181.185]) by hawkwind.utcs.utoronto.ca with SMTP id <44200>; Tue, 15 Aug 2000 15:15:58 -0500 Received: from localhost (user: 'smd', uid#42) by cesium.clock.org id <3021-8597>; Tue, 15 Aug 2000 06:32:30 -0700 From: smd@clock.org To: rc@hawkwind.utcs.toronto.edu Subject: Re: New rc snapshot, includes "the equals hack" Message-Id: <20000815133234Z3021-8597+4@cesium.clock.org> Date: Tue, 15 Aug 2000 09:32:30 -0500 Maybe I'm a bit of a crank, but I think for scripting work, the "equals hack" really doesn't buy much; the only time I even ponder it is when I am doing interactive work and forget that "arguments containing special characters must be quoted". Although I know that dd, make, and some GNU utilities like arguments which contain one of rc's special characters, and this can be frustrating if one forgets, I don't see why we should necessarily have: : sean(rc) ; echo foo=a foo=a but : sean(rc) ; echo foo^a fooa : sean(rc) ; echo foo&a 12978 a not found foo : sean(rc) ; echo foo;a foo a not found : sean(rc) ; echo foo$a foo and so forth. One of the neat things about rc is that there are few syntactic surprises; I think a rule that says "quote your arguments" and especially "arguments with special characters MUST be quoted" is consistent. Sean. From rc-owner Tue Aug 15 15:16:26 2000 Received: from proxy4.ba.best.com ([206.184.139.15]) by hawkwind.utcs.utoronto.ca with SMTP id <44193>; Tue, 15 Aug 2000 15:15:47 -0500 Received: from rakitzis.com ([207.20.242.213]) by proxy4.ba.best.com (8.9.3/8.9.2/best.out) with ESMTP id XAA27315; Mon, 14 Aug 2000 23:29:36 -0700 (PDT) Received: (from byron@localhost) by rakitzis.com (8.9.3/8.9.3) id XAA11162; Mon, 14 Aug 2000 23:28:48 -0700 Date: Tue, 15 Aug 2000 02:28:48 -0500 From: Byron Rakitzis Message-Id: <200008150628.XAA11162@rakitzis.com> To: gcarvell@wirefire.com, tjg@star.le.ac.uk Subject: Re: New rc snapshot, includes "the equals hack" Cc: rc@hawkwind.utcs.toronto.edu >Yes! Yes! Yes! Keep it!!! I just read my note to the list, and it seems very equivocal. I just wanted to say, even in its present form the equals hack is a big improvement over what's there right now. It's just that I've struggled with this problem before so I'm trying to see it in the context of the other efforts. In a perfect world I would love to see an equals hack which does the Right Thing. Byron. From rc-owner Tue Aug 15 19:21:30 2000 Received: from cesium.clock.org ([209.179.181.185]) by hawkwind.utcs.utoronto.ca with SMTP id <44194>; Tue, 15 Aug 2000 19:21:12 -0500 Received: from localhost (user: 'smd', uid#42) by cesium.clock.org id <3023-8593>; Tue, 15 Aug 2000 12:25:20 -0700 From: smd@clock.org To: rc@hawkwind.utcs.toronto.edu Subject: Re: New rc snapshot, includes "the equals hack" Message-Id: <20000815192525Z3023-8593+8@cesium.clock.org> Date: Tue, 15 Aug 2000 15:25:20 -0500 | YES! This fixes one of the few remaining things in rc that has caused | me grief and although I have gotten used to quoting the arguments to | FSF tools, e.g., autoconfig generated configure scripts, I would | prefer not to do it. By all means keep it. Sorry to be crank-like again, but while the rc + 'equals hack' can run old rc scripts just fine, anyone who writes any script without quoting an argument containing '=' will find it unportable to an 'unhacked' rc. Can one even _determine_ at run time that the equals hack is present, other than by causing an error? Sean. From rc-owner Tue Aug 15 19:21:39 2000 Received: from pantransit.reptiles.org ([209.157.133.146]) by hawkwind.utcs.utoronto.ca with SMTP id <44211>; Tue, 15 Aug 2000 19:21:26 -0500 Received: (qmail 112 invoked by uid 204); 15 Aug 2000 21:51:20 -0000 Date: Tue, 15 Aug 2000 17:51:20 -0500 Message-ID: <20000815215120.111.qmail@pantransit.reptiles.org> From: "Smarasderagd" To: rc@hawkwind.utcs.toronto.edu, tjg@star.le.ac.uk Subject: Re: New rc snapshot, includes "the equals hack" Tim Goodwin writes: >A new, and possibly controversial, rc development snapshot is available >from the usual place. > > http://www.star.le.ac.uk/~tjg/rc/snap/rc-1.6s20000811.tar.gz > >There are a few minor bug fixes, and the addition of the `-I' flag >from the Plan9 rc (the opposite of `-i': this shell is definitely not >interactive). See the full list of changes since the last beta at the >end of this message. > >In addition, this snapshot includes a cunning patch by Thomas Nordin >that permits `=' to appear, unquoted, outside assignments. For ease of >reference, I'm calling this "the equals hack", where the word "hack" is >not intended to have any pejorative connotations... > >The equals hack, which in fact was just a one line addition to the >grammar, effectively makes `=' stand for `^'='^' (when it's not an >assignment). The slightly surprising feature of this is that `=' >swallows whitespace around it. > > ; echo a = b > a=b > >Apart from that, everything works as you would expect. Well, I suppose expr's '=' operator isn't much of an issue, and the '>=' and '<=' operators need to be quoted anyway (I think.) Make runs with null assignments to makefile variables would still not work right, though. make Q= target turns into make Q=target Putting the Q= at the end results in a syntax error due to the trailing implicit caret, and you'll run into this problem with a trailing = anywhere. I'd rather have a fix that works completely, or just go on quoting things as I have been. From rc-owner Fri Aug 18 17:11:38 2000 Received: from fw.softwell.se ([193.15.236.45]) by hawkwind.utcs.utoronto.ca with SMTP id <44319>; Fri, 18 Aug 2000 17:10:38 -0500 Received: from trillian.softwell.se (IDENT:bengt@trillian.softwell.se [192.42.172.11]) by fw.softwell.se (8.9.3/8.9.3) with ESMTP id WAA29246; Fri, 18 Aug 2000 22:14:50 +0200 Received: (from bengt@localhost) by trillian.softwell.se (8.8.7/8.8.7) id WAA05227; Fri, 18 Aug 2000 22:14:50 +0200 Date: Fri, 18 Aug 2000 16:14:50 -0500 From: Bengt Kleberg Message-Id: <200008182014.WAA05227@trillian.softwell.se> To: rc@hawkwind.utcs.toronto.edu, tjg@star.le.ac.uk Subject: Re: New rc snapshot, includes "the equals hack" > permits `=' to appear, unquoted, outside assignments. Could this be made into a compile time switch? Ie, I do not want it, but I fully understand if others do. From rc-owner Fri Aug 18 17:12:03 2000 Received: from mail.rdc1.ct.home.com ([24.2.0.66]) by hawkwind.utcs.utoronto.ca with SMTP id <44242>; Fri, 18 Aug 2000 17:10:29 -0500 Received: from photek.dhs.org ([24.2.177.105]) by mail.rdc1.ct.home.com (InterMail vM.4.01.03.00 201-229-121) with SMTP id <20000817025154.CMVY9101.mail.rdc1.ct.home.com@photek.dhs.org>; Wed, 16 Aug 2000 19:51:54 -0700 Received: by photek.dhs.org (sSMTP sendmail emulation); Wed, 16 Aug 2000 22:53:54 +4400 Date: Wed, 16 Aug 2000 22:53:54 -0500 From: Decklin Foster To: Smarasderagd Cc: rc@hawkwind.utcs.toronto.edu Subject: Re: New rc snapshot, includes "the equals hack" Message-ID: <20000816225354.A3758@photek.dhs.org> References: <20000815215120.111.qmail@pantransit.reptiles.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20000815215120.111.qmail@pantransit.reptiles.org>; from smarry@vex.net on Tue, Aug 15, 2000 at 05:51:20PM -0500 Organization: Imperial Mica Board Smarasderagd writes: > make Q= target There is always make Q='', which also fixes the =-at-end-of-line problem. I'm somewhat ambivalent about offering workarounds, though, because I agree with what you have written below: > Putting the Q= at the end results in a syntax error due to the trailing > implicit caret, and you'll run into this problem with a trailing = > anywhere. I'd rather have a fix that works completely, or just go on > quoting things as I have been. It just feels too sneaky and obscure to me. Part of the appeal of rc is it's clear syntax; there aren't a lot of exceptions like this one. P.S. Just a heads up for the group: I have taken over maintainership of rc for Debian; feel free to contact me about any packaging issues. -- There is no TRUTH. There is no REALITY. There is no CONSISTENCY. There are no ABSOLUTE STATEMENTS. I'm very probably wrong. -- BSD fortune(6) From rc-owner Fri Aug 18 17:12:34 2000 Received: from apollo.le.ac.uk ([143.210.16.125]) by hawkwind.utcs.utoronto.ca with SMTP id <44254>; Fri, 18 Aug 2000 17:10:37 -0500 Received: from happy.star.le.ac.uk ([143.210.36.58]) by apollo.le.ac.uk with smtp (Exim 3.13 #2) id 13PMIi-0002R1-00 for rc@hawkwind.utcs.toronto.edu; Thu, 17 Aug 2000 10:49:28 +0100 Received: (qmail 8301 invoked from network); 17 Aug 2000 09:49:49 -0000 Received: from ltpcg.star.le.ac.uk (tjg@143.210.36.203) by happy.star.le.ac.uk with SMTP; 17 Aug 2000 09:49:49 -0000 To: rc@hawkwind.utcs.toronto.edu Subject: Re: New rc snapshot, includes "the equals hack" In-Reply-To: <20000815133234Z3021-8597+4@cesium.clock.org> <20000815215120.111.qmail@pantransit.reptiles.org> Date: Thu, 17 Aug 2000 05:49:25 -0500 From: Tim Goodwin Message-ID: > Maybe I'm a bit of a crank, but I think for scripting work, > the "equals hack" really doesn't buy much; Agreed. > : sean(rc) ; echo foo&a > 12978 > a not found > foo That's not really a valid analogy: `echo a&b' has a perfectly good meaning (even if it's probably not the one you wanted). This contrasts with `echo a=b' for which rc just spits back `syntax error', even though it has an unambiguous, and useful, meaning. > Putting the Q= at the end results in a syntax error due to the trailing > implicit caret, and you'll run into this problem with a trailing = > anywhere. I'd rather have a fix that works completely, or just go on > quoting things as I have been. And, as Byron pointed out, a doubled equals is also a syntax error. Both of these can be fixed by adding this production to the grammar. word : word '=' This introduces a large number of shift/reduce conflicts. My immediate reaction is that they should all be benign (since yacc always shifts, so it will only use this production when there's no valid longer parse), but I'd have to think about it a bit longer to really convince myself. Under this regime, the only odd special case I can find is `a==b', which remains a syntax error. > Sorry to be crank-like again, but while the rc + 'equals hack' can run > old rc scripts just fine, anyone who writes any script without quoting > an argument containing '=' will find it unportable to an 'unhacked' rc. Yes, that is a worry. One bletcherous possibility would be to allow the equals hack only when we're interactive. It's still only a two line patch, but they're starting to be rather long lines. :-) Time for a coffee, and I'll see if I can come up with anything better... Tim. --- parse.y 1998/07/10 13:41:38 1.2 +++ parse.y 2000/08/17 09:20:45 @@ -127,6 +127,8 @@ | keyword { $$ = mk(nWord,$1, NULL); } word : sword + | word '=' { if (interactive) { $$ = mk(nConcat,$1,mk(nWord,"=",NULL)); } else { yyerror("syntax error"); YYERROR; } } + | word '=' sword { if (interactive) { $$ = mk(nConcat,$1,mk(nConcat,mk(nWord,"=",NULL),$3)); } else { yyerror("syntax error"); YYERROR; } } | word '^' sword { $$ = mk(nConcat,$1,$3); } comword : '$' sword { $$ = mk(nVar,$2); } From rc-owner Mon Aug 21 18:23:51 2000 Received: from localhost by hawkwind.utcs.utoronto.ca with SMTP id <44191>; Mon, 21 Aug 2000 18:21:19 -0500 To: rc Subject: Re: New rc snapshot, includes "the equals hack" In-reply-to: decklin's message of Wed, 16 Aug 2000 22:53:54 -0500. <20000816225354.A3758@photek.dhs.org> Date: Mon, 21 Aug 2000 18:21:14 -0500 From: Chris Siebenmann Message-Id: <00Aug21.182119edt.44191@hawkwind.utcs.utoronto.ca> | It just feels too sneaky and obscure to me. Part of the appeal of rc | is it's clear syntax; there aren't a lot of exceptions like this one. Having read the messages to date and thought about the issue, I think that I agree with this. I prefer an rc where the rule I have to remember is 'quote ='s or get syntax errors', not '= will gobble the arguments on either side of it on a command line into one word' (or whatever the exact rule is). And slipups are far more evident and less mysterious with the first rule: I get a syntax error, which I can easily fix. - cks From rc-owner Tue Aug 22 15:14:01 2000 Received: from spock.linux.it ([151.99.137.27]) by hawkwind.utcs.utoronto.ca with SMTP id <44211>; Tue, 22 Aug 2000 15:13:58 -0500 Received: by spock.linux.it (Postfix, from userid 10) id 1D0551C6B0; Tue, 22 Aug 2000 12:51:27 +0200 (CEST) Received: from polka with UUCP (rmail); Tue, 22 Aug 2000 12:51:27 +0200 Received: from carlos by localhost with local (Exim 2.05 #1 (Debian)) id 13RBeI-0002vf-00; Tue, 22 Aug 2000 12:51:18 +0200 Date: Tue, 22 Aug 2000 06:51:18 -0500 From: Carlo Strozzi To: rc@hawkwind.utcs.toronto.edu Subject: Re: New rc snapshot, includes "the equals hack" Message-ID: <20000822125118.A11190@polka.libero.it> Reply-To: carlos@texne.com Mail-Followup-To: rc@hawkwind.utcs.toronto.edu References: <20000816225354.A3758@photek.dhs.org> <00Aug21.182119edt.44191@hawkwind.utcs.utoronto.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <00Aug21.182119edt.44191@hawkwind.utcs.utoronto.ca>; from cks@hawkwind.utcs.toronto.edu on Mon, Aug 21, 2000 at 06:21:14PM -0500 Organization: TeXne.COM On Mon, Aug 21, 2000 at 06:21:14PM -0500, Chris Siebenmann wrote: | | It just feels too sneaky and obscure to me. Part of the appeal of rc | | is it's clear syntax; there aren't a lot of exceptions like this one. | | Having read the messages to date and thought about the issue, I think | that I agree with this. I prefer an rc where the rule I have to remember | is 'quote ='s or get syntax errors', not '= will gobble the arguments | on either side of it on a command line into one word' (or whatever the | exact rule is). And slipups are far more evident and less mysterious | with the first rule: I get a syntax error, which I can easily fix. I personally share the same view. bye --carlo -- I can read MIME or uuencoded e-mail attachments in PDF, Postscript, HTML, RTF or text formats. Please do not send Word, Excel or PowerPoint files. From rc-owner Tue Aug 22 15:14:38 2000 Received: from proxy2.ba.best.com ([206.184.139.14]) by hawkwind.utcs.utoronto.ca with SMTP id <44193>; Tue, 22 Aug 2000 15:13:41 -0500 Received: from rakitzis.com ([207.20.242.213]) by proxy2.ba.best.com (8.9.3/8.9.2/best.out) with ESMTP id QAA00596; Mon, 21 Aug 2000 16:28:40 -0700 (PDT) Received: (from byron@localhost) by rakitzis.com (8.9.3/8.9.3) id QAA17096; Mon, 21 Aug 2000 16:28:01 -0700 Date: Mon, 21 Aug 2000 19:28:01 -0500 From: Byron Rakitzis Message-Id: <200008212328.QAA17096@rakitzis.com> To: cks@hawkwind.utcs.toronto.edu, rc@hawkwind.utcs.toronto.edu Subject: Re: New rc snapshot, includes "the equals hack" > Having read the messages to date and thought about the issue, I think > that I agree with this. I prefer an rc where the rule I have to remember > is 'quote ='s or get syntax errors', not '= will gobble the arguments > on either side of it on a command line into one word' (or whatever the > exact rule is). And slipups are far more evident and less mysterious > with the first rule: I get a syntax error, which I can easily fix. Well, the principle of "free carets" already establishes that there can be some counterintuitive parsing: ; ~a ; a~ a~ not found ; I guess the real problem is that = is an infix operator, and what's more multiple local assignments are allowed: a=foo b=bar cmd This more than anything bollixed up any attempt to do the Right Thing with yacc alone when I last puzzled over this (which was, mind you almost 10 years ago!). And what is the right thing? I guess it's easy to say in English: if '=' does not appear in an assignment it should be subject to free careting. This would be trivial to do in a recursive-descent parser which could communicate with the lexer, I'm unsure about how to accomplish it with yacc. I think there is enough historical precedent about the use of unquoted ='s in shells that to be forced quote them is a truly annoying bug. Byron. From rc-owner Tue Aug 22 18:24:29 2000 Received: from localhost by hawkwind.utcs.utoronto.ca with SMTP id <44204>; Tue, 22 Aug 2000 18:23:59 -0500 To: rc Subject: Re: New rc snapshot, includes "the equals hack" In-reply-to: byron's message of Mon, 21 Aug 2000 19:28:01 -0500. <200008212328.QAA17096@rakitzis.com> Date: Tue, 22 Aug 2000 18:23:50 -0500 From: Chris Siebenmann Message-Id: <00Aug22.182359edt.44204@hawkwind.utcs.utoronto.ca> | Well, the principle of "free carets" already establishes that there | can be some counterintuitive parsing: The difference to me is that 'free carets' doesn't move things around; it merely logically connects things that are already visually connected. This lets it work intuitively and do what the user expects. By contrast, the '=' hack does move things around, and I think that's the problem. It's also incomplete and surprising. So we have: ; echo a = b a=b ; echo a= b a=b ; echo a =b a=b Bonus unpleasant surprise: ; echo =b ; And we haven't even gotten away from needing quotes in some situations: ; echo a==b syntax error ; echo = syntax error I think that rearranging what the user types is jarringly out of place and counterintuitive. | I think there is enough historical precedent about the use of unquoted | ='s in shells that to be forced quote them is a truly annoying bug. I would rather be annoyed periodically than (unpleasantly) surprised. I fear that the current '=' hack is likely to deliver a fair amount of the latter. - cks From rc-owner Wed Aug 23 12:27:14 2000 Received: from proxy4.ba.best.com ([206.184.139.15]) by hawkwind.utcs.utoronto.ca with SMTP id <44204>; Wed, 23 Aug 2000 12:25:21 -0500 Received: from rakitzis.com ([207.20.242.213]) by proxy4.ba.best.com (8.9.3/8.9.2/best.out) with ESMTP id RAA01228; Tue, 22 Aug 2000 17:04:04 -0700 (PDT) Received: (from byron@localhost) by rakitzis.com (8.9.3/8.9.3) id RAA24556; Tue, 22 Aug 2000 17:03:24 -0700 Date: Tue, 22 Aug 2000 20:03:24 -0500 From: Byron Rakitzis Message-Id: <200008230003.RAA24556@rakitzis.com> To: cks@hawkwind.utcs.toronto.edu, rc@hawkwind.utcs.toronto.edu Subject: Re: New rc snapshot, includes "the equals hack" >I fear that the current '=' hack is likely to deliver a fair amount of >the latter. I'm sorry, I wasn't arguing in favor of the equals hack, merely *some* equals hack to do the right thing. Of all your examples: ; echo =b is the most troubling since sh does the visually obvious thing, but rc allows spaces between the '=' and its operands. That can't change without breaking old scripts. Byron. From rc-owner Fri Dec 29 23:03:16 2000 Received: from sanpietro.red-bean.com ([206.69.89.65]) by hawkwind.utcs.utoronto.ca with SMTP id <45147>; Fri, 29 Dec 2000 22:53:53 -0500 Received: (from decklin@localhost) by sanpietro.red-bean.com (8.9.3/8.9.3/Debian 8.9.3-21) id VAA13486 for rc@hawkwind.utcs.toronto.edu; Fri, 29 Dec 2000 21:47:05 -0600 Date: Fri, 29 Dec 2000 22:47:05 -0500 From: Decklin Foster To: rc@hawkwind.utcs.toronto.edu Subject: va_arg and short Message-ID: <20001229214705.A13372@sanpietro.red-bean.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Mutt/1.0.1i X-PGP-Key: 0xF1968D1B at keyring.debian.org X-LR8R: Money can't buy you respect so go ahead and do your worst. Organization: Fulminants Association rc 1.6b2 fails to compile on linux/ppc/gcc2.95.2/glibc2.2. The problem is in print.c line 107: n = va_arg(format->args, short); This code is incorrect, because a short argument to a variadic function will go through argument promotion and become an int. I am told that GCC 3 will refuse to compile this on any architecture, not just ppc. The patch below removes the short case and adds an explanatory note. --- print.c.orig Fri Dec 29 22:34:45 2000 +++ print.c Fri Dec 29 22:39:33 2000 @@ -103,9 +103,7 @@ if (flags & FMT_long) n = va_arg(format->args, long); - else if (flags & FMT_short) - n = va_arg(format->args, short); - else + else /* short and int are both promoted to int */ n = va_arg(format->args, int); pre = 0; -- things change. decklin@red-bean.com From rc-owner Sun Jan 21 22:42:27 2001 Received: from edisons.it ([212.104.1.252]) by hawkwind.utcs.utoronto.ca with SMTP id <44706>; Sun, 21 Jan 2001 22:41:16 -0500 Received: from localhost ([212.104.16.8]) by edisons.it ; Sun, 21 Jan 2001 16:43:57 +0100 Received: from carlos by localhost with local (Exim 3.12 #1 (Debian)) id 14KMYD-0000LZ-00; Sun, 21 Jan 2001 16:37:05 +0100 Date: Sun, 21 Jan 2001 10:37:05 -0500 From: Carlo Strozzi To: rc@hawkwind.utcs.toronto.edu Subject: akanga Message-ID: <20010121163705.A407@polka.texne.com> Mail-Followup-To: rc@hawkwind.utcs.toronto.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Mutt/1.0.1i Organization: TeXne.COM Hi all. Foraging around the net I have found a little rc-based gem, which name is "akanga". In spite of such an horrible name (IMO) -- I would have called it rc+ or something like that -- this shell, which is 99% pure rc, offers exactly those little improvements that the original rc is lacking, the most outstanding of which are: * read (for line-oriented input) * mktemp * let * expr * lock Now my question: what about incorporating those features into the main rc source code ? I sent a message to akanga's author, mr. Wolfgang Zekoll, asking about his future plans, if any, for akanga, but I got no reply. My concern is that if the handful of code that implements those features does not get merged into the main rc source, akanga will eventually get out of sync with the latter and become obsolete. That would really be a shame. cheers, carlo -- _ _ _ _ _ / \ / \ / \ / \ / \ Contro i brevetti software ( T | e | X | n | e ) Against software patents \_/ \_/ \_/ \_/ \_/ http://petition.eurolinux.org From rc-owner Tue Jan 23 17:24:38 2001 Received: from edisons.it ([212.104.1.252]) by hawkwind.utcs.utoronto.ca with SMTP id <44924>; Tue, 23 Jan 2001 17:23:44 -0500 Received: from localhost ([212.104.24.33]) by edisons.it ; Tue, 23 Jan 2001 22:21:59 +0100 Received: from carlos by localhost with local (Exim 3.12 #1 (Debian)) id 14LAt3-0000rg-00; Tue, 23 Jan 2001 22:21:57 +0100 Date: Tue, 23 Jan 2001 16:21:57 -0500 From: Carlo Strozzi To: rc@hawkwind.utcs.toronto.edu Subject: segmentation fault Message-ID: <20010123222157.A3291@tango.texne.com> Reply-To: carlos@texne.com Mail-Followup-To: Carlo Strozzi , rc@hawkwind.utcs.toronto.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Organization: TeXne.COM Hi, this is an old bug, but apparently it has not gone away yet: ; ~ () '*' Segmentation fault Tested against rc 1.6, on a glibc-2.1.3 i386 machine. cheers, carlo -- _ _ _ _ _ / \ / \ / \ / \ / \ Contro i brevetti software ( T | e | X | n | e ) Against software patents \_/ \_/ \_/ \_/ \_/ http://petition.eurolinux.org From rc-owner Thu Jan 25 18:05:49 2001 Received: from apollo.le.ac.uk ([143.210.16.125]) by hawkwind.utcs.utoronto.ca with SMTP id <44988>; Thu, 25 Jan 2001 18:04:20 -0500 Received: from happy.star.le.ac.uk ([143.210.36.58]) by apollo.le.ac.uk with smtp (Exim 3.16 #1) id 14LMHT-0000OJ-00 for rc@hawkwind.utcs.toronto.edu; Wed, 24 Jan 2001 09:31:55 +0000 Received: (qmail 22954 invoked from network); 24 Jan 2001 09:32:16 -0000 Received: from fozzie.star.le.ac.uk (tjg@143.210.36.216) by happy.star.le.ac.uk with SMTP; 24 Jan 2001 09:32:16 -0000 Subject: Re: segmentation fault In-Reply-To: <20010123222157.A3291@tango.texne.com> To: carlos@texne.com CC: rc@hawkwind.utcs.toronto.edu Date: Wed, 24 Jan 2001 04:31:54 -0500 From: Tim Goodwin Message-ID: <1AQAACChbjrG7AEA@ltsun0.star.le.ac.uk> > ; ~ () '*' > Segmentation fault > > Tested against rc 1.6, on a glibc-2.1.3 i386 machine. I fixed this 2000-04-19, but I haven't made a release since then (not even a beta, although there are more recent snapshots). Sorry, folks. Watch this space... Tim. From rc-owner Mon May 28 05:30:33 2001 Received: from imr3.srv.uk.deuba.com ([194.205.246.162]) by hawkwind.utcs.utoronto.ca with SMTP id <45234>; Mon, 28 May 2001 05:30:13 -0500 Received: from imr1.srv.uk.deuba.com by imr3.srv.uk.deuba.com id f4S7lBC24933; Mon, 28 May 2001 08:47:11 +0100 (BST) Received: from pi.aus.deuba.com [10.179.3.11] by imr1.srv.uk.deuba.com id f4S7kjC27062; Mon, 28 May 2001 08:46:46 +0100 (BST) Received: (qmail 4739 invoked by uid 325); 28 May 2001 07:47:03 -0000 Message-ID: <20010528074702.4737.qmail@mailhost.aus.deuba.com> To: rc@hawkwind.utcs.toronto.edu From: Russell Davies Subject: bug? Date: Mon, 28 May 2001 03:47:00 -0500 ; mkdir $HOME/e ; cdpath=$HOME ; cd / ; cd e /home/blah/e ok, all is well. Suppose now I want to suppress the output of the cd e. ; cd / ; cd e >/dev/null ; pwd / huh? I haven't had time to dig too deeply but if someone else has looked at it before, I won't bother. r. From rc-owner Mon May 28 14:49:10 2001 Received: from smtp2.libero.it ([193.70.192.52]) by hawkwind.utcs.utoronto.ca with SMTP id <45243>; Mon, 28 May 2001 14:49:01 -0500 Received: from tango (151.15.144.99) by smtp2.libero.it (5.5.025) id 3AE981AF006BDEBA for rc@hawkwind.utcs.toronto.edu; Mon, 28 May 2001 11:55:02 +0200 Received: from carlos by tango with local (Exim 3.12 #1 (Debian)) id 154Jjw-0001g5-00; Mon, 28 May 2001 11:55:08 +0200 Date: Mon, 28 May 2001 05:55:08 -0500 From: Carlo Strozzi To: rc@hawkwind.utcs.toronto.edu Subject: Re: bug? Message-ID: <20010528115508.G4481@tango.texne.com> Mail-Followup-To: Carlo Strozzi , rc@hawkwind.utcs.toronto.edu References: <20010528074702.4737.qmail@mailhost.aus.deuba.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010528074702.4737.qmail@mailhost.aus.deuba.com>; from russell.davies@db.com on Mon, May 28, 2001 at 03:47:00AM -0500 Organization: TeXne.COM On Mon, May 28, 2001 at 03:47:00AM -0500, Russell Davies wrote: | | ; mkdir $HOME/e | ; cdpath=$HOME | ; cd / | ; cd e | /home/blah/e | | ok, all is well. Suppose now I want to suppress the output of the cd e. | | ; cd / | ; cd e >/dev/null | ; pwd | / I believe the '>' redirection causes cd to be executed in a subshell, and when the latter dies so does the cd effect. bye, carlo -- Carlo Strozzi TeXne.COM - Open Consulting Mail: carlos@texne.com Voice: (+39)0523-883732 Fax: (+39)0523-840980 From rc-owner Mon May 28 14:49:12 2001 Received: from proxy2.ba.best.com ([206.184.139.14]) by hawkwind.utcs.utoronto.ca with SMTP id <45271>; Mon, 28 May 2001 14:49:04 -0500 Received: from rakitzis.com ([207.20.242.213]) by proxy2.ba.best.com (8.9.3/8.9.2/best.out) with ESMTP id JAA05580; Mon, 28 May 2001 09:21:21 -0700 (PDT) Received: (from byron@localhost) by rakitzis.com (8.11.0/8.11.0) id f4SGKkI02864; Mon, 28 May 2001 09:20:46 -0700 Date: Mon, 28 May 2001 12:20:46 -0500 From: Byron Rakitzis Message-Id: <200105281620.f4SGKkI02864@rakitzis.com> To: rc@hawkwind.utcs.toronto.edu, russell.davies@db.com Subject: Re: bug? Whether it's a bug depends on your expectations -- but redirections happen in a subshell and you'd have to know that. You could do: exec > /dev/null cd e exec > /dev/tty From rc-owner Mon May 28 14:49:13 2001 Received: from web10702.mail.yahoo.com ([216.136.130.210]) by hawkwind.utcs.utoronto.ca with SMTP id <45258>; Mon, 28 May 2001 14:49:04 -0500 Message-ID: <20010528142013.80482.qmail@web10702.mail.yahoo.com> Received: from [206.170.1.4] by web10702.mail.yahoo.com; Mon, 28 May 2001 07:20:12 PDT Date: Mon, 28 May 2001 10:20:12 -0500 From: Paul Haahr Reply-To: paul@paulhaahr.com Subject: Re: bug? To: Russell Davies Cc: rc@hawkwind.utcs.toronto.edu In-Reply-To: <20010528074702.4737.qmail@mailhost.aus.deuba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii --- Russell Davies wrote: > > ; mkdir $HOME/e > ; cdpath=$HOME > ; cd / > ; cd e > /home/blah/e > > ok, all is well. Suppose now I want to suppress the output of the cd > e. > > ; cd / > ; cd e >/dev/null > ; pwd > / > > huh? I haven't had time to dig too deeply but if someone else has > looked at it before, I won't bother. I don't have a Unix box in front of me to test or access to the source, but rc commands with redirected I/O run in subshells; thus, the directory of your child process is changed, but not the parent process. (I think we fixed that in es by remapping file descriptors all over the place and forking way late in the game.) --p __________________________________________________ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/ From rc-owner Wed May 30 03:33:41 2001 Received: from imr1.bain.com.au ([203.0.62.7]) by hawkwind.utcs.utoronto.ca with SMTP id <45564>; Wed, 30 May 2001 03:33:12 -0500 Received: from bmr1-e1.aus.deuba.com by imr1.bain.com.au id f4U5YY826129; Wed, 30 May 2001 15:34:34 +1000 (EST) Received: from mailhost.aus.deuba.com [10.179.4.6] by bmr1-e1.aus.deuba.com id f4U5YX027913; Wed, 30 May 2001 15:34:33 +1000 (EST) Received: from merton.aus.deuba.com (merton.bain.com.au [10.179.23.56]) by mailhost.aus.deuba.com (8.9.1/8.9.1) with ESMTP id PAA12433 for ; Wed, 30 May 2001 15:34:33 +1000 (EST) Received: (from callum@localhost) by merton.aus.deuba.com (8.11.2/8.11.2/SuSE Linux 8.11.1-0.5) id f4U5YWh18448 for rc@hawkwind.utcs.utoronto.ca; Wed, 30 May 2001 15:34:32 +1000 From: Callum Gibson Message-Id: <200105300534.f4U5YWh18448@merton.aus.deuba.com> Subject: history and multiple substitutions To: rc@hawkwind.utcs.utoronto.ca (rc Shell) Date: Wed, 30 May 2001 01:34:32 -0500 X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit G'day. I'm a recovering *csh user. I hope it's not too presumptuous to post a patch in my first post, but I figure source code is always welcome. A colleague at work has put me on to rc and he thought this patch nifty enough to pass on to you all. One of the annoyances of csh's ^ (and now rc's :) history substitution for me has been that it only replaces the first occurrence on the line. I frequently redirect output into a file based upon the args of the program I'm running. e.g. ; prog abc > output.abc ; prog def > output.def etc. So ^abc^def (or "- abc:def") will clobber your first output file. The patch below alters history.c such that consecutive colons (:) in the - and -- history subsitition function, will subsitute your pattern according to the number of colons you supply. (A more general approach is to change the existing syntax to mean replace until there are no more matches, but I decided to apply POLA here.) The original semantics don't escape unscathed but I think this is a reasonable compromise. Thus: ; prog abc > output.abc ; - abc::def prog def > output.def ; - def::ghi prog ghi > output.ghi etc. I hope someone finds it useful. If there's enough interest I'll update the manpage accordingly too. Oh, this diff is against rc-1.6 release, but it looks like history.c hasn't changed in some time in any case. regards, C (c)2001 Callum Gibson callum.gibson@db.com Fixed Income IT, Deutsche Bank, Australia 61 2 9258 1620 ### The opinions presented herein do not represent those of my employer ### --- history.c.orig Sat Dec 5 03:32:40 1998 +++ history.c Wed May 30 11:48:07 2001 @@ -26,6 +26,7 @@ static struct { char *old, *new; + int reps; /* no. of repetitions. i.e. 1 means sub twice. */ } *replace; static char **search, *progname, *history; @@ -296,8 +297,12 @@ search[nsearch++] = argv[i]; else { *(char *)s = '\0'; /* do we confuse ps too much? */ + replace[nreplace].reps = 0; + while(*(++s) == ':') { + replace[nreplace].reps++; + } replace[nreplace].old = argv[i]; - replace[nreplace].new = s + 1; + replace[nreplace].new = s; nreplace++; } @@ -312,8 +317,11 @@ for (i = 0; i < nreplace; i++) if (!isin(s, replace[i].old)) goto next; - else - s = sub(s, replace[i].old, replace[i].new); + else { + int j; + for (j = 0; j <= replace[i].reps; j++) + s = sub(s, replace[i].old, replace[i].new); + } if (editit) { s = edit(s); if (s == NULL) From rc-owner Mon Jun 18 10:59:00 2001 Received: from apollo.le.ac.uk ([143.210.16.125]) by hawkwind.utcs.utoronto.ca with SMTP id <45699>; Mon, 18 Jun 2001 10:58:34 -0500 Received: from happy.star.le.ac.uk ([143.210.36.58]) by apollo.le.ac.uk with smtp (Exim 3.16 #1) id 15BzN8-0004Fj-00 for rc@hawkwind.utcs.utoronto.ca; Mon, 18 Jun 2001 14:47:18 +0100 Received: (qmail 3661 invoked from network); 18 Jun 2001 13:47:39 -0000 Received: from fozzie.star.le.ac.uk (tjg@143.210.36.216) by happy.star.le.ac.uk with QMQP; 18 Jun 2001 13:47:39 -0000 Date: Mon, 18 Jun 2001 09:47:39 -0500 Message-ID: <20010618134739.20958.qmail@happy.star.le.ac.uk> From: Tim Goodwin To: rc@hawkwind.utcs.utoronto.ca Subject: New snapshot rc-1.6s200106-18 available I'm sorry that there's been no news of rc recently; I've been engrossed in other project (monadic parser combinators, anyone? :-). Anyway, a couple of significant problems have emerged recently: newer versions of gcc don't allow you even to pretend to pass a short to a stdargs function; and job control seems to have got even more complex. This snapshot fixes both those, and a few other nits. A full list of changes since the last beta is appended. Please test this, and report any problems back to me; I'd like to get a new beta out the door soon. Thanks, Tim. 2000-04-19 Bug: isatty() tests in input.c are relevant to any fd, not just 0. Now `. -i /dev/tty' works right. Bug: fn sigexit wasn't always cleared in child shells. Bug: `~ () '*'' dumped core. 2000-05-25 Portability: need special runes for read() returning EIO under job control systems. 2000-06-20 Feature: add `-I' flag (definitively not interactive) for compatibility with Plan 9 rc. 2000-11-27 Portability: configure fails to detect strerror() on NetBSD; we need to include . 2001-06-18 Bug: you can't pass a short to a stdargs function! From rc-owner Mon Jun 18 11:15:15 2001 Received: from apollo.le.ac.uk ([143.210.16.125]) by hawkwind.utcs.utoronto.ca with SMTP id <45691>; Mon, 18 Jun 2001 11:15:06 -0500 Received: from happy.star.le.ac.uk ([143.210.36.58]) by apollo.le.ac.uk with smtp (Exim 3.16 #1) id 15C0dF-0005Ua-00 for rc@hawkwind.utcs.toronto.edu; Mon, 18 Jun 2001 16:08:01 +0100 Received: (qmail 11426 invoked from network); 18 Jun 2001 15:08:23 -0000 Received: from fozzie.star.le.ac.uk (tjg@143.210.36.216) by happy.star.le.ac.uk with QMQP; 18 Jun 2001 15:08:23 -0000 Date: Mon, 18 Jun 2001 11:08:23 -0500 Message-ID: <20010618150823.21612.qmail@happy.star.le.ac.uk> From: Tim Goodwin To: rc@hawkwind.utcs.toronto.edu In-reply-to: <20010618134739.20958.qmail@happy.star.le.ac.uk> (tjg@star.le.ac.uk) Subject: Re: New snapshot rc-1.6s200106-18 available References: <20010618134739.20958.qmail@happy.star.le.ac.uk> > Please test this, and report any problems back to me; I'd like to get > a new beta out the door soon. What I forgot to say, was where to get the new snapshot! http://www.star.le.ac.uk/~tjg/rc/snap/rc-1.6s20010618.tar.gz Incidentally, is there anyone who *can't* easily fetch files via HTTP these days? Tim. From rc-owner Mon Jun 18 13:57:21 2001 Received: from quanstro.net ([216.27.138.42]) by hawkwind.utcs.utoronto.ca with SMTP id <45722>; Mon, 18 Jun 2001 13:57:18 -0500 Received: by quanstro.net (Postfix, from userid 210) id 911073EA0A; Mon, 18 Jun 2001 13:41:34 -0400 (EDT) To: rc@hawkwind.utcs.toronto.edu From: erik quanstrom Subject: rc-1.6s20010618 configuration problems Message-Id: <20010618174134.911073EA0A@quanstro.net> Date: Mon, 18 Jun 2001 13:41:34 -0500 autoconf seems not to like me [...] checking how to run the C preprocessor... grep: *+: No such file or directory gcc -E checking for ln... ln checking for sys/resource.h... grep: *+: No such file or directory yes checking for sys/time.h... grep: *+: No such file or directory yes checking for sys/types.h... grep: *+: No such file or directory yes checking for unistd.h... grep: *+: No such file or directory yes [...] ; uname -a Linux linuxdev.somewhere.com 2.2.16-3smp #1 SMP Fri Oct 27 19:01:58 PDT 2000 i686 unknown -- erik From rc-owner Mon Jun 18 14:30:51 2001 Received: from quanstro.net ([216.27.138.42]) by hawkwind.utcs.utoronto.ca with SMTP id <45729>; Mon, 18 Jun 2001 14:30:47 -0500 Received: by quanstro.net (Postfix, from userid 210) id 7F6FF3EA0A; Mon, 18 Jun 2001 14:27:40 -0400 (EDT) To: rc@hawkwind.utcs.toronto.edu From: erik quanstrom Subject: -V ? Message-Id: <20010618182740.7F6FF3EA0A@quanstro.net> Date: Mon, 18 Jun 2001 14:27:40 -0500 the NEWS file claims a -V option, which doesn't seem to exist in main.c erik From rc-owner Tue Jun 19 16:33:30 2001 Received: from apollo.le.ac.uk ([143.210.16.125]) by hawkwind.utcs.utoronto.ca with SMTP id <45829>; Tue, 19 Jun 2001 16:32:58 -0500 Received: from happy.star.le.ac.uk ([143.210.36.58]) by apollo.le.ac.uk with smtp (Exim 3.16 #1) id 15CHNH-0004Vg-00 for rc@hawkwind.utcs.toronto.edu; Tue, 19 Jun 2001 10:00:39 +0100 Received: (qmail 21141 invoked from network); 19 Jun 2001 09:01:01 -0000 Received: from fozzie.star.le.ac.uk (tjg@143.210.36.216) by happy.star.le.ac.uk with QMQP; 19 Jun 2001 09:01:01 -0000 Date: Tue, 19 Jun 2001 05:01:01 -0500 Message-ID: <20010619090101.24010.qmail@happy.star.le.ac.uk> From: Tim Goodwin To: quanstro@quanstro.net CC: rc@hawkwind.utcs.toronto.edu In-reply-to: <20010618182740.7F6FF3EA0A@quanstro.net> Subject: Re: -V ? References: <20010618182740.7F6FF3EA0A@quanstro.net> > the NEWS file claims a -V option, which doesn't seem to > exist in main.c Ah, hmm, well. I haven't updated the NEWS file since the 1.6 release; it still describes changes since 1.4. This is an oversight, rather than a deliberate policy! I've scratched the file, and started again with major changes since the 1.6 release (of which there aren't all that many). So in the next snapshot / beta, NEWS will be relevant again. As to the `-V' flag, I replaced it with the `$version' variable. This makes it easy to find the version of the current rc, which you couldn't do with the `-V' flag, and you can always say rc -c 'whatis version' to get the effect of the old `-V'. Tim. From rc-owner Mon Sep 3 00:27:04 2001 Received: from mta03-svc.ntlworld.com ([62.253.162.43]) by hawkwind.utcs.utoronto.ca with SMTP id <50642>; Mon, 3 Sep 2001 00:24:31 -0500 Received: from freeze2k ([62.254.2.198]) by mta03-svc.ntlworld.com (InterMail vM.4.01.03.00 201-229-121) with ESMTP id <20010901041029.COPF23687.mta03-svc.ntlworld.com@freeze2k>; Sat, 1 Sep 2001 05:10:29 +0100 Date: Sat, 1 Sep 2001 00:11:16 -0500 From: Matt X-Mailer: The Bat! (v1.53d) Reply-To: Matt X-Priority: 3 (Normal) Message-ID: <7126271516.20010901051116@proweb.co.uk> To: 9fans <9fans@cse.psu.edu> CC: rc@hawkwind.utcs.utoronto.ca Subject: unix RC shell bug In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit after hours of not noticing one of my variables was a list and not a string (it's 5am I've been on this since 10pm!) I eventually got to this sorry state. in good ol' plan9 cpu% t=(1 2 3 6 7) cpu% echo $#t 5 cpu% echo $"t 1 2 3 6 7 in /usr/local/bin/rc (ver 1.6) on FreeBSD (ver 4.2-RELEASE) ; t=(1 2 3 6 7) ; echo $#t 5 ; echo $"t syntax error just fyi From rc-owner Mon Sep 3 01:31:51 2001 Received: from imr1.aus.deuba.com ([203.0.62.7]) by hawkwind.utcs.utoronto.ca with SMTP id <47841>; Mon, 3 Sep 2001 01:30:18 -0500 Received: from bmr1-e1.aus.deuba.com by imr1.aus.deuba.com id f835EEh01488; Mon, 3 Sep 2001 15:14:14 +1000 (EST) Received: from mailhost.aus.deuba.com [10.179.4.6] by bmr1-e1.aus.deuba.com id f835EE609808; Mon, 3 Sep 2001 15:14:14 +1000 (EST) Received: from merton.aus.deuba.com (merton.aus.deuba.com [10.179.88.22]) by mailhost.aus.deuba.com (8.9.1/8.9.1) with ESMTP id PAA20269; Mon, 3 Sep 2001 15:14:13 +1000 (EST) Received: (from callum@localhost) by merton.aus.deuba.com (8.11.2/8.11.2/SuSE Linux 8.11.1-0.5) id f835ECF12579; Mon, 3 Sep 2001 15:14:12 +1000 From: Callum Gibson Message-Id: <200109030514.f835ECF12579@merton.aus.deuba.com> Subject: Re: unix RC shell bug To: matt@proweb.co.uk Date: Mon, 3 Sep 2001 01:14:12 -0500 Cc: rc@hawkwind.utcs.toronto.edu In-Reply-To: <7126271516.20010901051116@proweb.co.uk> from "matt@proweb.co.uk" at Sep 01, 2001 12:11:16 AM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit matt@proweb.co.uk writes: }cpu% echo $"t }1 2 3 6 7 The list flattening operator is ^ not " in the unix rc. i.e. echo $^t This is mentioned in the INCOMPATIBILITIES section of the manpage. Don't know why this is the case, other than to avoid possible confusion with the meaning of " as a quote char in other unix shells, plus ^ is used as the concatenation operator anyway as in: ; echo (a b c)^(1 2 3) (c)2001 Callum Gibson callum.gibson@db.com Global Markets IT, Deutsche Bank, Australia 61 2 9258 1620 ### The opinions in this message are mine and not Deutsche's ### From rc-owner Mon Sep 3 01:33:22 2001 Received: from newton.hartwick.edu ([147.205.85.10]) by hawkwind.utcs.utoronto.ca with SMTP id <48063>; Mon, 3 Sep 2001 01:31:49 -0500 Received: from decklin.2y.net (terminus.hartwick.edu [147.205.111.131]) by newton.hartwick.edu with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2448.0) id RNKB6110; Mon, 3 Sep 2001 01:16:55 -0400 Received: by decklin.2y.net (sSMTP sendmail emulation); Mon, 3 Sep 2001 01:18:59 -0400 Date: Mon, 3 Sep 2001 01:18:59 -0500 From: Decklin Foster To: Matt Cc: rc@hawkwind.utcs.toronto.edu Subject: Re: unix RC shell bug Message-ID: <20010903011859.A10088@decklin.2y.net> References: <7126271516.20010901051116@proweb.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7126271516.20010901051116@proweb.co.uk> User-Agent: Mutt/1.3.20i X-GPG-Key: finger://debian.org/decklin@debian.org X-LR8R: Money can't buy you respect so go ahead and do your worst. Organization: Fulminants Association Matt writes: > ; echo $"t > syntax error It's $^t -- See the INCOMPATIBILITES section in the man page. I am unsure of the reasons for this, but the ChangeLog notes: 1999-01-05 Documentation: the Bell Labs rc now has the list flattening operator, but spelt $"foo. -- things change. decklin@red-bean.com From rc-owner Mon Sep 3 02:28:30 2001 Received: from proxy4.ba.best.com ([206.184.139.15]) by hawkwind.utcs.utoronto.ca with SMTP id <51134>; Mon, 3 Sep 2001 02:27:00 -0500 Received: from rakitzis.com ([207.20.242.213]) by proxy4.ba.best.com (8.9.3/8.9.2/best.out) with ESMTP id XAA18025; Sun, 2 Sep 2001 23:23:46 -0700 (PDT) Received: (from byron@localhost) by rakitzis.com (8.11.0/8.11.0) id f836N3N10505; Sun, 2 Sep 2001 23:23:03 -0700 Date: Mon, 3 Sep 2001 02:23:03 -0500 From: Byron Rakitzis Message-Id: <200109030623.f836N3N10505@rakitzis.com> To: decklin@red-bean.com, matt@proweb.co.uk Subject: Re: unix RC shell bug Cc: rc@hawkwind.utcs.toronto.edu $^ came years before $" was introduced into plan9's rc. I guess there's no reason not to make Unix rc understand $" as well, but it would be important to leave $^ as is. From rc-owner Mon Sep 3 03:37:13 2001 Received: from pantransit.reptiles.org ([209.157.133.146]) by hawkwind.utcs.utoronto.ca with SMTP id <51137>; Mon, 3 Sep 2001 03:35:41 -0500 Received: (qmail 4448 invoked by uid 204); 3 Sep 2001 07:19:20 -0000 Date: Mon, 3 Sep 2001 03:19:20 -0500 Message-ID: <20010903071920.4447.qmail@pantransit.reptiles.org> From: "Smarasderagd" To: byron@rakitzis.com, decklin@red-bean.com, matt@proweb.co.uk Subject: Re: unix RC shell bug Cc: rc@hawkwind.utcs.toronto.edu Byron Rakitzis writes: >$^ came years before $" was introduced into plan9's rc. > >I guess there's no reason not to make Unix rc understand $" as well, >but it would be important to leave $^ as is. Ideally, other uses of " should not become syntax errors, although I haven't taken advantage of it being just another character myself. From rc-owner Mon Sep 3 19:26:45 2001 Received: from mta02-svc.ntlworld.com ([62.253.162.42]) by hawkwind.utcs.utoronto.ca with SMTP id <47841>; Mon, 3 Sep 2001 19:26:27 -0500 Received: from freeze2k ([62.254.2.198]) by mta02-svc.ntlworld.com (InterMail vM.4.01.03.00 201-229-121) with ESMTP id <20010903081915.NVRT29790.mta02-svc.ntlworld.com@freeze2k> for ; Mon, 3 Sep 2001 09:19:15 +0100 Date: Mon, 3 Sep 2001 04:20:08 -0500 From: Matt X-Mailer: The Bat! (v1.53d) Reply-To: Matt X-Priority: 3 (Normal) Message-ID: <12343845476.20010903092008@proweb.co.uk> To: rc@hawkwind.utcs.toronto.edu Subject: $^t MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit thanks ppl my fault for not getting far enough down the man page to see the INCOMPATIBILITES section. I didn't even envisage that there would be any. Kudos to Byron for the project at all but I would've thought that the project goal was NO incompatibilites. However now I've been enlightened to the parallel history I can see that the user base albatross flaps it's wings. Well it least I'm on the list now so I'll know about things in advance. Matt From rc-owner Mon Sep 3 23:09:16 2001 Received: from proxy2.ba.best.com ([206.184.139.14]) by hawkwind.utcs.utoronto.ca with SMTP id <47841>; Mon, 3 Sep 2001 23:09:05 -0500 Received: from rakitzis.com ([207.20.242.213]) by proxy2.ba.best.com (8.9.3/8.9.2/best.out) with ESMTP id SAA15682; Mon, 3 Sep 2001 18:44:35 -0700 (PDT) Received: (from byron@localhost) by rakitzis.com (8.11.0/8.11.0) id f841ht416783; Mon, 3 Sep 2001 18:43:55 -0700 Date: Mon, 3 Sep 2001 21:43:55 -0500 From: Byron Rakitzis Message-Id: <200109040143.f841ht416783@rakitzis.com> To: matt@proweb.co.uk Subject: Re: $^t Cc: rc@hawkwind.utcs.toronto.edu > thanks ppl > > my fault for not getting far enough down the man page to see the > INCOMPATIBILITES section. I didn't even envisage that there would be > any. > > Kudos to Byron for the project at all but I would've thought that the > project goal was NO incompatibilites. Well, it started out that way but in 1990 plan 9 was a closed system and I didn't see any problem with fixing some of the glaring flaws (I think "if not" falls in that category. However, on the subject of "if not", at this point if anyone could hack it into the grammar and still make the current behavior of "else" work I think that would be a good thing). Furthermore Unix != Plan 9 so I had to take the initiative on some matters to make the shell work properly under Unix. That being said now that Plan 9 is more open perhaps the more superficial incompatabilities should be normalized, if possible. Byron. From rc-owner Mon Sep 3 23:28:44 2001 Received: from imr1.aus.deuba.com ([203.0.62.7]) by hawkwind.utcs.utoronto.ca with SMTP id <51162>; Mon, 3 Sep 2001 23:28:34 -0500 Received: from bmr1-e1.aus.deuba.com by imr1.aus.deuba.com id f843GSh27598; Tue, 4 Sep 2001 13:16:29 +1000 (EST) Received: from mailhost.aus.deuba.com [10.179.4.6] by bmr1-e1.aus.deuba.com id f843GS609985; Tue, 4 Sep 2001 13:16:28 +1000 (EST) Received: from merton.aus.deuba.com (merton.aus.deuba.com [10.179.88.22]) by mailhost.aus.deuba.com (8.9.1/8.9.1) with ESMTP id NAA16872 for ; Tue, 4 Sep 2001 13:16:27 +1000 (EST) Received: (from callum@localhost) by merton.aus.deuba.com (8.11.2/8.11.2/SuSE Linux 8.11.1-0.5) id f843GRP17441 for rc@hawkwind.utcs.toronto.edu; Tue, 4 Sep 2001 13:16:27 +1000 From: Callum Gibson Message-Id: <200109040316.f843GRP17441@merton.aus.deuba.com> Subject: Re: $^t To: rc@hawkwind.utcs.toronto.edu Date: Mon, 3 Sep 2001 23:16:27 -0500 In-Reply-To: <200109040143.f841ht416783@rakitzis.com> from "byron@rakitzis.com" at Sep 03, 2001 09:43:55 PM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit byron@rakitzis.com writes: }That being said now that Plan 9 is more open perhaps the more }superficial incompatabilities should be normalized, if possible. FWIW, I think $^t is more logical since it conserves special chars, even if it reverses the sense of the ^ operator. (c)2001 Callum Gibson callum.gibson@db.com Global Markets IT, Deutsche Bank, Australia 61 2 9258 1620 ### The opinions in this message are mine and not Deutsche's ### From rc-owner Wed Sep 5 18:07:34 2001 Received: from mail.paulhaahr.com ([63.203.198.9]) by hawkwind.utcs.utoronto.ca with SMTP id <51212>; Wed, 5 Sep 2001 18:06:51 -0500 Received: (from haahr@localhost) by mail.paulhaahr.com (8.9.3/8.9.3) id UAA01224; Tue, 4 Sep 2001 20:37:18 -0700 X-Authentication-Warning: dmul.paulhaahr.com: haahr set sender to haahr@paulhaahr.com using -f Message-Id: <8XBpTIaE1V@dmul.paulhaahr.com> Date: Tue, 4 Sep 2001 23:37:16 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit From: Paul Haahr To: rc@hawkwind.utcs.toronto.edu Subject: Re: $^t In-Reply-To: <200109040316.f843GRP17441@merton.aus.deuba.com> References: <200109040143.f841ht416783@rakitzis.com> <200109040316.f843GRP17441@merton.aus.deuba.com> X-Mailer: VM 6.30 under Emacs 20.7.1 Callum Gibson wrote > FWIW, I think $^t is more logical since it conserves special chars, even > if it reverses the sense of the ^ operator. I don't think it reverses the sense at all. $^ was originally intended to mean ``repeated application of the ^ operator on a variable.'' For what it's worth, that syntax in Byron's implementation appears to date from early 1991: From: byron@archone.tamu.edu (Byron Rakitzis) To: haahr@adobe.com Subject: list flattening Date: Wed, 9 Jan 91 17:55:45 CST is now in as an operator. yip yip. (I also have a drop of rc from half an hour before that message which doesn't include $^, so we can be fairly precise about its timing.) --p From rc-owner Mon Oct 15 15:44:31 2001 Received: from artemis.le.ac.uk ([143.210.16.126]) by hawkwind.utcs.utoronto.ca with SMTP id <46200>; Mon, 15 Oct 2001 15:43:32 -0500 Received: from happy.star.le.ac.uk ([143.210.36.58]) by artemis.le.ac.uk with smtp (Exim 3.16 #1) id 15t7HV-00050c-00 for rc@hawkwind.utcs.utoronto.ca; Mon, 15 Oct 2001 13:55:45 +0100 Received: (qmail 13392 invoked from network); 15 Oct 2001 12:56:06 -0000 Received: from morpheus.star.le.ac.uk (143.210.36.121) by happy.star.le.ac.uk with QMQP; 15 Oct 2001 12:56:06 -0000 Date: Mon, 15 Oct 2001 08:56:06 -0500 Message-ID: <20011015125606.2248.qmail@happy.star.le.ac.uk> From: Tim Goodwin To: rc@hawkwind.utcs.utoronto.ca Subject: Beta release rc-1.6b3 available A new beta release, rc-1.6b3, is available from the usual place. http://www.star.le.ac.uk/~tjg/rc/beta/rc-1.6b3.tar.gz Please test this beta! I'd like to turn it into rc-1.7, but it needs a lot more testing first. I need positive feedback (platforms where it builds and runs smoothly) as well as reports of any problems. The NEWS file from this release is appended: it describes significant changes since the rc-1.6 full release. Further details are in the ChangeLog file in the distribution, and even more details can be found on my new "hacking notes" page; anyone who is, or would like to be, familiar with rc's internals is encouraged to look at this page. http://www.star.le.ac.uk/~tjg/rc/misc/notes The only major missing feature that I'm aware of is support for the 4.4 BSD libedit. This is planned, but probably not till after rc-1.7. Tim. Highlights of changes since rc-1.6. See ChangeLog for further details. Portability. Many minor tweaks, including fixes for BeOS, CygWin, and gcc-3. Bug fixes. A number of bugs have been fixed. The serious ones were: a core dump, triggered by `~ () '*''; premature exit, triggered by sourcing a file which could be open()ed but not read() (such as a directory on many systems); uninterruptible looping, triggered by semantic errors in `fn prompt'. New features. The following features are new: the `$version' variable replaces the `-V' flag; the `-I' flag (definitively not interactive) was added for compatibility with the Plan 9 rc; ASCII SOH (^A) is now handled transparently. Documentation. Distributions of this rc used to include a PostScript paper given by Tom Duff to the UKUUG, describing the Plan 9 rc. This paper is no longer distributed with rc, but instead is available on the web, both in its original PostScript version, and an updated HTML version. Tim Goodwin 2001-10-05 From rc-owner Thu Oct 18 00:56:17 2001 Received: from mail.splashground.de ([195.30.95.93]) by hawkwind.utcs.utoronto.ca with SMTP id <44665>; Thu, 18 Oct 2001 00:55:01 -0500 Received: (qmail 15259 invoked by uid 500); 17 Oct 2001 15:21:24 -0000 Message-ID: <20011017152124.15258.qmail@mail.splashground.de> Content-Type: text/plain; charset="iso-8859-1" From: Buggs Organization: splashground To: Tim Goodwin , rc@hawkwind.utcs.toronto.edu Subject: Re: Beta release rc-1.6b3 available Date: Wed, 17 Oct 2001 09:13:41 -0500 X-Mailer: KMail [version 1.3.1] References: <20011015125606.2248.qmail@happy.star.le.ac.uk> In-Reply-To: <20011015125606.2248.qmail@happy.star.le.ac.uk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On Monday 15 October 2001 15:56, Tim Goodwin wrote: > A new beta release, rc-1.6b3, is available from the usual place. Thanks. > Please test this beta! I'd like to turn it into rc-1.7, but it needs > a lot more testing first. I need positive feedback (platforms where > it builds and runs smoothly) as well as reports of any problems. Suse Linux 7.2 with a CVS gcc-3.1 from last week does fine. But there are some issues, not version dependant, that I don't understand. This will get out of control: ; fn l {ls -l $*} ; fn l {l -a $*} ; l And what about job control, how do I handle that? Thanks, Buggs From rc-owner Thu Oct 18 00:57:12 2001 Received: from artemis.le.ac.uk ([143.210.16.126]) by hawkwind.utcs.utoronto.ca with SMTP id <44666>; Thu, 18 Oct 2001 00:56:12 -0500 Received: from happy.star.le.ac.uk ([143.210.36.58]) by artemis.le.ac.uk with smtp (Exim 3.16 #1) id 15tqpz-0002gt-00 for rc@hawkwind.utcs.toronto.edu; Wed, 17 Oct 2001 14:34:23 +0100 Received: (qmail 14515 invoked from network); 17 Oct 2001 13:34:45 -0000 Received: from morpheus.star.le.ac.uk (143.210.36.121) by happy.star.le.ac.uk with QMQP; 17 Oct 2001 13:34:45 -0000 Date: Wed, 17 Oct 2001 09:34:45 -0500 Message-ID: <20011017133445.9850.qmail@happy.star.le.ac.uk> From: Tim Goodwin To: buggs-rc@splashground.de CC: rc@hawkwind.utcs.toronto.edu In-reply-to: <20011017152124.15258.qmail@mail.splashground.de> (buggs-rc@splashground.de) Subject: Re: Beta release rc-1.6b3 available References: <20011015125606.2248.qmail@happy.star.le.ac.uk> <20011017152124.15258.qmail@mail.splashground.de> > Suse Linux 7.2 with a CVS gcc-3.1 from last week does fine. Thanks for the report. (Keep 'em coming, folks!) > But there are some issues, not version dependant, that I don't understand. > This will get out of control: > > ; fn l {ls -l $*} > ; fn l {l -a $*} > ; l Your function `l' always calls itself recursively, so it rapidly runs out of stack. Remember that, unlike other shells, rc is not a macro processor. In particular, the `l' in the function body of your second definition is *not* expanded using the previous definition of `fn l'. (You can always use `whatis' to see the current definition of a function.) A simple fn l { ls -la $* } is probably what you want. Also, check out the `builtin' builtin, which allows a function to call a builtin or external command of the same name without recursing: fn ls { builtin ls -F $* } > And what about job control, how do I handle that? This shell does not have job control. It has been said (by Duff? Pike? Rakitzis? I forget...) that job control adds a deal of complexity to handle just the easy part of a hard problem. The suggested alternative in a windowing environment is to open a new window. If you're not in a windowing environment, you might like the `screen' program, which does both the easy and hard parts of the problem. There's also a "tabbed" version of gnome-terminal around, called `multignometerm'. Tim. From rc-owner Thu Oct 18 00:58:05 2001 Received: from mail.splashground.de ([195.30.95.93]) by hawkwind.utcs.utoronto.ca with SMTP id <44711>; Thu, 18 Oct 2001 00:57:08 -0500 Received: (qmail 16190 invoked by uid 500); 17 Oct 2001 22:20:58 -0000 Message-ID: <20011017222058.16189.qmail@mail.splashground.de> Content-Type: text/plain; charset="iso-8859-1" From: Buggs Organization: splashground To: Tim Goodwin Subject: Re: Beta release rc-1.6b3 available Date: Wed, 17 Oct 2001 16:13:12 -0500 X-Mailer: KMail [version 1.3.1] Cc: rc@hawkwind.utcs.toronto.edu References: <20011015125606.2248.qmail@happy.star.le.ac.uk> <20011017152124.15258.qmail@mail.splashground.de> <20011017133445.9850.qmail@happy.star.le.ac.uk> In-Reply-To: <20011017133445.9850.qmail@happy.star.le.ac.uk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On Wednesday 17 October 2001 15:34, Tim Goodwin wrote: > > Suse Linux 7.2 with a CVS gcc-3.1 from last week does fine. > > Thanks for the report. (Keep 'em coming, folks!) Your welcome. I migth be able to provide a few others next week. > > But there are some issues, not version dependant, that I don't > > understand. This will get out of control: > > > > ; fn l {ls -l $*} > > ; fn l {l -a $*} > > ; l > > Your function `l' always calls itself recursively, so it rapidly runs > out of stack. Thougth so. > Remember that, unlike other shells, rc is not a macro processor. In > particular, the `l' in the function body of your second definition is > *not* expanded using the previous definition of `fn l'. (You can > always use `whatis' to see the current definition of a function.) So my old definition is lost and it constantly calls itself. > A simple > > fn l { ls -la $* } > > is probably what you want. Yes, probably. But I also wondered about the why of the failure and why I did not receive a warning (could have been a bug after all). [...] > > And what about job control, how do I handle that? > > This shell does not have job control. > > It has been said (by Duff? Pike? Rakitzis? I forget...) that job > control adds a deal of complexity to handle just the easy part of a > hard problem. The suggested alternative in a windowing environment is > to open a new window. I see. That was exactly what I wanted to know, thanks. > If you're not in a windowing environment, you might like the `screen' > program, which does both the easy and hard parts of the problem. > There's also a "tabbed" version of gnome-terminal around, called > `multignometerm'. Never used multignometerm but that is the way KDE's konsole takes, which I can also recommend. Thanks again, Buggs From rc-owner Fri Oct 19 17:18:52 2001 Received: from artemis.le.ac.uk ([143.210.16.126]) by hawkwind.utcs.utoronto.ca with SMTP id <45008>; Fri, 19 Oct 2001 17:18:27 -0500 Received: from happy.star.le.ac.uk ([143.210.36.58]) by artemis.le.ac.uk with smtp (Exim 3.16 #1) id 15ucHs-0001en-00 for rc@hawkwind.utcs.toronto.edu; Fri, 19 Oct 2001 17:14:20 +0100 Received: (qmail 17013 invoked from network); 19 Oct 2001 16:14:41 -0000 Received: from fozzie.star.le.ac.uk (tjg@143.210.36.216) by happy.star.le.ac.uk with QMQP; 19 Oct 2001 16:14:41 -0000 Date: Fri, 19 Oct 2001 12:14:40 -0500 Message-ID: <20011019161440.1621.qmail@happy.star.le.ac.uk> From: Tim Goodwin To: gcarvell@wirefire.com CC: rc@hawkwind.utcs.toronto.edu In-reply-to: <20011019004843.A429@gc.wirefire.com> (gcarvell@wirefire.com) Subject: Re: Beta release rc-1.6b3 available References: <20011015125606.2248.qmail@happy.star.le.ac.uk> <20011019004843.A429@gc.wirefire.com> > rc 1.6b3 builds, makes trip, and runs fine for me. This > is on a PC running Slackware Linux 8.0 (kernel 2.4.12, > 2.2.3). Haven't done any exotic testing but I'm using > it as my login shell with no problems. Thanks for the report. Incidentally, so far the only problem report with rc-1.6b3 was a thinko in the documentation (now fixed). If anybody's discovered any problems at all, *please* let me know. Thanks! > It appears that the consensus > was not to include [the equals hack] in rc, but I wondered if it > could be a build-time option or even a commented line > in parse.y that the user could enable at build time. I'm not sure if there was anything as grand as consensus! I agree with you that it should be available in some way to those that want it; probably as a configure `--with-eq-hack' option or somesuch (although at the same time I'm reluctant to introduce yet more configure options). At the moment, I really want to get rc-1.7 out the door, as it does contain important bug and portability fixes over rc-1.6. When that's done, we can reconsider more exotic things... Regards, Tim. From rc-owner Tue Oct 23 05:48:18 2001 Received: from smtp1.libero.it ([193.70.192.51]) by hawkwind.utcs.utoronto.ca with SMTP id <45353>; Tue, 23 Oct 2001 05:47:34 -0500 Received: from tango.texne.priv (151.15.134.54) by smtp1.libero.it (6.0.032) id 3BD437D50002CA96 for rc@hawkwind.utcs.toronto.edu; Tue, 23 Oct 2001 08:59:44 +0200 Received: from carlos by tango.texne.priv with local (Exim 3.12 #1 (Debian)) id 15vvTh-0004HG-00; Tue, 23 Oct 2001 08:55:57 +0200 Date: Tue, 23 Oct 2001 02:55:57 -0500 From: Carlo Strozzi To: rc@hawkwind.utcs.toronto.edu Subject: Re: Beta release rc-1.6b3 available Message-ID: <20011023085557.A16410@texne.com> Mail-Followup-To: Carlo Strozzi , rc@hawkwind.utcs.toronto.edu References: <20011015125606.2248.qmail@happy.star.le.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20011015125606.2248.qmail@happy.star.le.ac.uk>; from tjg@star.le.ac.uk on Mon, Oct 15, 2001 at 08:56:06AM -0500 Organization: ScriptaWorks.COM On Mon, Oct 15, 2001 at 08:56:06AM -0500, Tim Goodwin wrote: > A new beta release, rc-1.6b3, is available from the usual place. > > http://www.star.le.ac.uk/~tjg/rc/beta/rc-1.6b3.tar.gz > > Please test this beta! I'd like to turn it into rc-1.7, but it needs > a lot more testing first. I need positive feedback (platforms where > it builds and runs smoothly) as well as reports of any problems. Mine is not really a bug report, buth rather a request for a new feature. I dunno whether it has been asked before on this list, but are there any chances that rc will ever handle a path specification in the form of: ; command ~/path/to/file where ``~'' gets substituted internally with the value of $home ? Likewise, ~user should be replaced by $home/user/. Of course this is a-la-bash, but it would make rc much more handy to use as a login shell. The executable that I use has been linked with the GNU readline library, which handles the above cases correctly, but when it passes the path to rc the latter complains, of course. bye, carlo -- For easier reading please set the Courier font. Messages larger than 30 KB may not receive immediate attention. Freedom for Business: http://swpat.ffii.org From rc-owner Tue Oct 23 14:16:02 2001 Received: from artemis.le.ac.uk ([143.210.16.126]) by hawkwind.utcs.utoronto.ca with SMTP id <44842>; Tue, 23 Oct 2001 14:15:27 -0500 Received: from happy.star.le.ac.uk ([143.210.36.58]) by artemis.le.ac.uk with smtp (Exim 3.16 #1) id 15vzyc-0003NR-00 for rc@hawkwind.utcs.toronto.edu; Tue, 23 Oct 2001 12:44:10 +0100 Received: (qmail 24254 invoked from network); 23 Oct 2001 11:44:31 -0000 Received: from fozzie.star.le.ac.uk (tjg@143.210.36.216) by happy.star.le.ac.uk with QMQP; 23 Oct 2001 11:44:31 -0000 Date: Tue, 23 Oct 2001 07:44:31 -0500 Message-ID: <20011023114431.3825.qmail@happy.star.le.ac.uk> From: Tim Goodwin To: carlos@scriptaworks.com CC: rc@hawkwind.utcs.toronto.edu In-reply-to: <20011023085557.A16410@texne.com> (carlos@scriptaworks.com) Subject: Re: Beta release rc-1.6b3 available References: <20011015125606.2248.qmail@happy.star.le.ac.uk> <20011023085557.A16410@texne.com> > Mine is not really a bug report, buth rather a request for a new > feature. I dunno whether it has been asked before on this list, but Trust me: it has been asked before :-). > are there any chances that rc will ever handle [tilde expansion ?] Probably not. Before it could happen, we would need: i) somebody to figure out how tilde expansion can co-exist with rc's existing interpretation of tilde; OR ii) somebody to persuade the tilde expanders of an alternate syntax they are happy with. Note that if you can twist option ii) far enough, rc *already* has tilde expansion :-). ; fn h {if(~ () $1){echo $home}else perl -le 'print ((getpwnam('^$1^'))[7])'} ; echo `h /h/tjg ; echo `{h games} /usr/games You should be horrified at the use of Perl here, so compile the program below as `homedir', and use: ; fn h {if(~ () $1){echo $home}else homedir $1} Cheers, Tim. #include #include #include int main(int argc, char **argv) { if (argv[1]) { struct passwd *p = getpwnam(argv[1]); if (p) puts(p->pw_dir); } } From rc-owner Tue Oct 23 14:16:19 2001 Received: from faui02.informatik.uni-erlangen.de ([131.188.30.102]) by hawkwind.utcs.utoronto.ca with SMTP id <45378>; Tue, 23 Oct 2001 14:16:11 -0500 Received: from folly.informatik.uni-erlangen.de (root@localhost [127.0.0.1]) by faui02.informatik.uni-erlangen.de (8.9.1/8.1.16-FAU) with ESMTP id QAA11934; Tue, 23 Oct 2001 16:48:09 +0200 (MEST) Received: by folly.informatik.uni-erlangen.de (Postfix, from userid 31451) id 9C73B4530; Tue, 23 Oct 2001 16:47:53 +0200 (CEST) Date: Tue, 23 Oct 2001 10:47:52 -0500 From: Markus Friedl To: Carlo Strozzi , rc@hawkwind.utcs.toronto.edu Subject: Re: Beta release rc-1.6b3 available Message-ID: <20011023164752.A18640@folly> References: <20011015125606.2248.qmail@happy.star.le.ac.uk> <20011023085557.A16410@texne.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20011023085557.A16410@texne.com>; from carlos@scriptaworks.com on Tue, Oct 23, 2001 at 02:55:57AM -0500 On Tue, Oct 23, 2001 at 02:55:57AM -0500, Carlo Strozzi wrote: > ; command ~/path/to/file this has been discussed 1000 times, please check the mail archive. -m From rc-owner Tue Oct 23 14:16:20 2001 Received: from ns.ca.certicom.com ([209.121.99.5]) by hawkwind.utcs.utoronto.ca with SMTP id <45380>; Tue, 23 Oct 2001 14:16:11 -0500 Received: from smtpmail.certicom.com (domino2.certicom.com [10.0.1.25]) by ns.ca.certicom.com (Postfix) with SMTP id 86E8217BE for ; Tue, 23 Oct 2001 13:51:55 -0400 (EDT) Received: from sroberts.(none) ([10.0.2.195]) by smtpmail.certicom.com (Lotus SMTP MTA v4.6.4 (830.2 3-23-1999)) with SMTP id 85256AEE.0051C983; Tue, 23 Oct 2001 10:53:20 -0400 Received: (nullmailer pid 29463 invoked by uid 1425); Tue, 23 Oct 2001 14:55:03 -0000 Date: Tue, 23 Oct 2001 10:55:02 -0500 From: Sam Roberts To: rc@hawkwind.utcs.toronto.edu Subject: Re: Beta release rc-1.6b3 available Message-ID: <20011023105502.A28670@certicom.com> References: <20011015125606.2248.qmail@happy.star.le.ac.uk> <20011023085557.A16410@texne.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20011023085557.A16410@texne.com> User-Agent: Mutt/1.3.23i I'd like to second this. It's the only reason I don't use rc as my shell, other than that I really like it. Does anybody have a patch? Sam Quoting Carlo Strozzi , who wrote: > Mine is not really a bug report, buth rather a request for a new > feature. I dunno whether it has been asked before on this list, but > are there any chances that rc will ever handle a path specification > in the form of: > > ; command ~/path/to/file > > where ``~'' gets substituted internally with the value of $home ? > Likewise, ~user should be replaced by $home/user/. Of course this > is a-la-bash, but it would make rc much more handy to use as > a login shell. The executable that I use has been linked with the > GNU readline library, which handles the above cases correctly, but > when it passes the path to rc the latter complains, of course. -- Sam Roberts From rc-owner Tue Oct 23 18:06:27 2001 Received: from smtp3.libero.it ([193.70.192.53]) by hawkwind.utcs.utoronto.ca with SMTP id <45422>; Tue, 23 Oct 2001 18:06:01 -0500 Received: from tango.texne.priv (151.15.152.180) by smtp3.libero.it (6.0.032) id 3BD43E250006EC77 for rc@hawkwind.utcs.toronto.edu; Tue, 23 Oct 2001 22:14:48 +0200 Received: from carlos by tango.texne.priv with local (Exim 3.12 #1 (Debian)) id 15w7rl-0004X1-00; Tue, 23 Oct 2001 22:09:37 +0200 Date: Tue, 23 Oct 2001 16:09:37 -0500 From: Carlo Strozzi To: rc@hawkwind.utcs.toronto.edu Subject: Re: Beta release rc-1.6b3 available Message-ID: <20011023220937.A17282@texne.com> Mail-Followup-To: Carlo Strozzi , rc@hawkwind.utcs.toronto.edu References: <20011015125606.2248.qmail@happy.star.le.ac.uk> <20011023085557.A16410@texne.com> <20011023164752.A18640@folly> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20011023164752.A18640@folly>; from markus@openbsd.org on Tue, Oct 23, 2001 at 04:47:52PM +0200 Organization: ScriptaWorks.COM On Tue, Oct 23, 2001 at 04:47:52PM +0200, Markus Friedl wrote: > On Tue, Oct 23, 2001 at 02:55:57AM -0500, Carlo Strozzi wrote: > > ; command ~/path/to/file > > this has been discussed 1000 times, please check > the mail archive. And another 1000 times it will probably be asked again in the future by another 1000 people who think that such a feature would make sense :-) Joking apart, I like rc very much, also because its supporters are so reluctant about making it a feature-packed shell. I just think that a `--with-tilde-hack' switch at configure time would not require more syntax-tweaking than a `--with-eq-hack' one :-) cheers, carlo -- For easier reading please set the Courier font. Messages larger than 30 KB may not receive immediate attention. Freedom for Business: http://swpat.ffii.org From rc-owner Tue Oct 23 18:06:29 2001 Received: from smtp1.libero.it ([193.70.192.51]) by hawkwind.utcs.utoronto.ca with SMTP id <45436>; Tue, 23 Oct 2001 18:06:20 -0500 Received: from tango.texne.priv (151.15.155.222) by smtp1.libero.it (6.0.032) id 3BD437D5000749A4 for rc@hawkwind.utcs.toronto.edu; Tue, 23 Oct 2001 22:44:48 +0200 Received: from carlos by tango.texne.priv with local (Exim 3.12 #1 (Debian)) id 15w8EH-0004Yf-00; Tue, 23 Oct 2001 22:32:53 +0200 Date: Tue, 23 Oct 2001 16:32:53 -0500 From: Carlo Strozzi To: rc@hawkwind.utcs.toronto.edu Subject: Re: Beta release rc-1.6b3 available Message-ID: <20011023223253.B17282@texne.com> Mail-Followup-To: Carlo Strozzi , rc@hawkwind.utcs.toronto.edu References: <20011015125606.2248.qmail@happy.star.le.ac.uk> <20011023085557.A16410@texne.com> <20011023114431.3825.qmail@happy.star.le.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20011023114431.3825.qmail@happy.star.le.ac.uk>; from tjg@star.le.ac.uk on Tue, Oct 23, 2001 at 07:44:31AM -0500 Organization: ScriptaWorks.COM On Tue, Oct 23, 2001 at 07:44:31AM -0500, Tim Goodwin wrote: (...) > > You should be horrified at the use of Perl here, so compile the I definitely am :-) (...) > int main(int argc, char **argv) { > if (argv[1]) { > struct passwd *p = getpwnam(argv[1]); > if (p) > puts(p->pw_dir); (...) Well, a nice piece of awk would fit equally well here. But apart from that, of course my point was to have rc go well with the GNU realine library (tab-completion and that), and the above does not really fit the bill. On the other hand, one of the nice things abot rc is that it has a small memory footprint, and adding features would make it worse in that respect. I think I'll leave without tilde expansion, and continue to use rc mostly for scripting :-) Thanks anyway, and keep up with the good work. bye, carlo -- For easier reading please set the Courier font. Messages larger than 30 KB may not receive immediate attention. Freedom for Business: http://swpat.ffii.org From rc-owner Tue Oct 23 22:11:01 2001 Received: from galapagos.cse.psu.edu ([130.203.12.17]) by hawkwind.utcs.utoronto.ca with SMTP id <45480>; Tue, 23 Oct 2001 22:10:07 -0500 Received: (qmail 11830 invoked by uid 991); 22 Oct 2001 05:47:59 -0000 Message-ID: <20011022054759.11828.qmail@g.bio.cse.psu.edu> To: Tim Goodwin cc: rc@hawkwind.utcs.toronto.edu Subject: Re: Beta release rc-1.6b3 available In-Reply-To: Message from Tim Goodwin of "Fri, 19 Oct 2001 12:14:40 CDT." <20011019161440.1621.qmail@happy.star.le.ac.uk> Date: Mon, 22 Oct 2001 01:47:59 -0500 From: Scott Schwartz What, if anything, should we do about large file support? From rc-owner Tue Oct 23 22:11:02 2001 Received: from galapagos.cse.psu.edu ([130.203.12.17]) by hawkwind.utcs.utoronto.ca with SMTP id <45484>; Tue, 23 Oct 2001 22:10:51 -0500 Received: (qmail 27524 invoked by uid 991); 23 Oct 2001 20:14:10 -0000 Message-ID: <20011023201410.27522.qmail@g.bio.cse.psu.edu> To: Sam Roberts cc: rc@hawkwind.utcs.toronto.edu Subject: Re: Beta release rc-1.6b3 available In-Reply-To: Message from Sam Roberts of "Tue, 23 Oct 2001 10:55:02 CDT." <20011023105502.A28670@certicom.com> Date: Tue, 23 Oct 2001 16:14:09 -0500 From: Scott Schwartz > I'd like to second this. It's the only reason I don't use rc as my > shell, other than that I really like it. Does anybody have a patch? I use "$h" for my home instead of "~". It's a little longer, but not really harder to type. I use /u/user for home directories, which is easy if you have an automounter (or Plan 9), and which works with all programs. It's funny to call the tilde thing "a-la-bash", since it was invented for csh many years before bash was written. Mail thru hawkwind is very slow these days; is there a problem? From rc-owner Tue Oct 23 22:25:16 2001 Received: from localhost by hawkwind.utcs.utoronto.ca with SMTP id <45456>; Tue, 23 Oct 2001 22:25:07 -0500 To: rc Subject: Re: Beta release rc-1.6b3 available In-reply-to: schwartz's message of Mon, 22 Oct 2001 01:47:59 -0500. <20011022054759.11828.qmail@g.bio.cse.psu.edu> Date: Tue, 23 Oct 2001 22:25:04 -0500 From: Chris Siebenmann Message-Id: <01Oct23.222507edt.45456@hawkwind.utcs.utoronto.ca> | What, if anything, should we do about large file support? In my limited experience and experimentation, it suffixes to compile rc with the right magic option. No actual source code changes seem necessary. The only seeking rc seems to do is in history.c (and that's not to a variable position); it's otherwise pretty uncaring about most of the large file issues. The only reason I recompiled rc with large file support (on Linux) was so that commands could have stdin/stdout redirected from/to large files. I don't know if autoconf et al has a test for large file support. If it does, it might be worth building rc that way automatically. If not, it's pretty easy to add the magic #define (actually usually a -D) by hand. - cks From rc-owner Tue Oct 23 22:34:26 2001 Received: from localhost by hawkwind.utcs.utoronto.ca with SMTP id <45459>; Tue, 23 Oct 2001 22:34:16 -0500 To: rc Subject: Re: Beta release rc-1.6b3 available In-reply-to: Your message of "Tue, 23 Oct 2001 16:32:53 CDT." <20011023223253.B17282@texne.com> Date: Tue, 23 Oct 2001 22:34:14 -0500 From: Chris Siebenmann Message-Id: <01Oct23.223416edt.45459@hawkwind.utcs.utoronto.ca> | On the other hand, one of the nice things abot rc is that it has a | small memory footprint, and adding features would make it worse in | that respect. Tilde expansion is particularly bad in that respect because it drags in a large collection of code from the C library. In extreme cases, it may not be possible to statically link something that uses getpwnam() because the mechanisms for flexible username lookups require runtime loaded dynamic libraries. If you do tilde expansion through the filesystem (for example, via a /u directory full of symlinks from usernames to their real home directory) you can gain the benefit of GNU readline auto-completion as well as significant universality at the price of only a little extra typing. - cks From rc-owner Tue Oct 23 22:47:56 2001 Received: from galapagos.cse.psu.edu ([130.203.12.17]) by hawkwind.utcs.utoronto.ca with SMTP id <45468>; Tue, 23 Oct 2001 22:47:51 -0500 Received: (qmail 29944 invoked by uid 991); 24 Oct 2001 02:41:42 -0000 Message-ID: <20011024024142.29942.qmail@g.bio.cse.psu.edu> To: Chris Siebenmann cc: rc@hawkwind.utcs.toronto.edu Subject: Re: Beta release rc-1.6b3 available In-Reply-To: Message from Chris Siebenmann of "Tue, 23 Oct 2001 22:25:04 CDT." <01Oct23.222507edt.45456@hawkwind.utcs.utoronto.ca> Date: Tue, 23 Oct 2001 22:41:42 -0500 From: Scott Schwartz | The only reason I recompiled rc with large | file support (on Linux) was so that commands could have stdin/stdout | redirected from/to large files. Yes, that's what I had in mind. | I don't know if autoconf et al has a test for large file support. It does. We probably ought to use it. From rc-owner Wed Oct 24 04:01:58 2001 Received: from smtp1.libero.it ([193.70.192.51]) by hawkwind.utcs.utoronto.ca with SMTP id <45486>; Wed, 24 Oct 2001 04:01:41 -0500 Received: from tango.texne.priv (151.15.155.202) by smtp1.libero.it (6.0.032) id 3BD437D50008475E for rc@hawkwind.utcs.toronto.edu; Wed, 24 Oct 2001 09:14:46 +0200 Received: from carlos by tango.texne.priv with local (Exim 3.12 #1 (Debian)) id 15wI52-0004pk-00; Wed, 24 Oct 2001 09:04:00 +0200 Date: Wed, 24 Oct 2001 03:04:00 -0500 From: Carlo Strozzi To: rc@hawkwind.utcs.toronto.edu Subject: Re: Beta release rc-1.6b3 available Message-ID: <20011024090400.G17282@texne.com> Mail-Followup-To: Carlo Strozzi , rc@hawkwind.utcs.toronto.edu References: <20011023223253.B17282@texne.com> <01Oct23.223416edt.45459@hawkwind.utcs.utoronto.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <01Oct23.223416edt.45459@hawkwind.utcs.utoronto.ca>; from cks@hawkwind.utcs.toronto.edu on Tue, Oct 23, 2001 at 10:34:14PM -0500 Organization: ScriptaWorks.COM On Tue, Oct 23, 2001 at 10:34:14PM -0500, Chris Siebenmann wrote: > > If you do tilde expansion through the filesystem (for example, via a > /u directory full of symlinks from usernames to their real home > directory) you can gain the benefit of GNU readline auto-completion as > well as significant universality at the price of only a little extra > typing. Yes, I agree that that is probably the best compromise. I'll revert back to that. thanks, carlo -- For easier reading please set the Courier font. Messages larger than 30 KB may not receive immediate attention. Freedom for Business: http://swpat.ffii.org From rc-owner Sat Oct 27 22:54:37 2001 Received: from hotmail.com ([216.33.241.182]) by hawkwind.utcs.utoronto.ca with SMTP id <46313>; Sat, 27 Oct 2001 22:53:47 -0500 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Fri, 26 Oct 2001 15:57:00 -0700 Received: from 65.194.128.160 by lw8fd.law8.hotmail.msn.com with HTTP; Fri, 26 Oct 2001 22:57:00 GMT X-Originating-IP: [65.194.128.160] From: "Gary Carvell" To: rc@hawkwind.utcs.toronto.edu Subject: Re: Beta release rc-1.6b3 available Date: Fri, 26 Oct 2001 18:57:00 -0500 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 26 Oct 2001 22:57:00.0996 (UTC) FILETIME=[85AAC040:01C15E71] I noticed a minor problem in the Makefile.in for people who will be rebuilding the parser with yacc. This is in the rule for parse.c near the bottom of the file, that you must comment in to run yacc. Lines 526-527, once you remove the leading '#' sign, begin with spaces instead of the tab character that Make likes. If you uncomment these lines without changing the tabs to spaces, you get this error from make: Makefile:526: *** missing separator. Stop. I imagine this will be one of your easier bug fixes... Gary -- Gary Carvell gcarvell@wirefire.com _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp From rc-owner Wed Oct 31 16:48:48 2001 Received: from artemis.le.ac.uk ([143.210.16.126]) by hawkwind.utcs.utoronto.ca with SMTP id <46448>; Wed, 31 Oct 2001 16:47:43 -0500 Received: from happy.star.le.ac.uk ([143.210.36.58]) by artemis.le.ac.uk with smtp (Exim 3.16 #1) id 15yy46-0003vn-00 for rc@hawkwind.utcs.utoronto.ca; Wed, 31 Oct 2001 16:18:06 +0000 Received: (qmail 24418 invoked from network); 31 Oct 2001 16:18:24 -0000 Received: from fozzie.star.le.ac.uk (tjg@143.210.36.216) by happy.star.le.ac.uk with QMQP; 31 Oct 2001 16:18:24 -0000 Date: Wed, 31 Oct 2001 11:18:24 -0500 Message-ID: <20011031161824.1422.qmail@happy.star.le.ac.uk> From: Tim Goodwin To: rc@hawkwind.utcs.utoronto.ca Subject: Release candidate rc-1.6c4 available A new beta release, which is also a release candidate for the next full release, is available from the usual place. http://www.star.le.ac.uk/~tjg/rc/beta/rc-1.6c4.tar.gz I've appended the (short!) ChangeLog since the last beta release. I need your help to decide if this release candidate is a trick or a treat. I'm using this version (with GNU readline) on RedHat, SunOS, and Tru64. I've also built and tripped it on CygWin, Irix, NetBSD, and OpenBSD. *Particularly* if you're using a different OS than these, I need you to test out this release candidate, and let me know how it goes. But if you're using one of these, you're not excused: test it anyway, try a different line editing library, proof read some documentation... As always, your feedback makes rc better for everyone. Thanks, Tim. 2001-10-25 Feature: large file support (thanks Scott Schwartz, Chris Siebenmann). 2001-10-29 Bug: space vs tab confusion in commented out Makefile rules to rebuild parser (thanks Gary Carvell). 2001-10-31 Documentation: subscripted variables don't work in here documents. Release: rc-1.6c4. From rc-owner Thu Nov 1 11:58:26 2001 Received: from quanstro.net ([66.92.161.167]) by hawkwind.utcs.utoronto.ca with SMTP id <46492>; Thu, 1 Nov 2001 11:58:15 -0500 Received: by quanstro.net (Postfix, from userid 210) id 072423F403; Thu, 1 Nov 2001 11:20:00 -0500 (EST) To: rc@hawkwind.utcs.toronto.edu From: erik quanstrom Subject: Re: Release candidate rc-1.6c4 available Message-Id: <20011101162000.072423F403@quanstro.net> Date: Thu, 1 Nov 2001 11:20:00 -0500 okay, i'm missing something. what was needed to have rc support large files? there is only one seek in rc -- and it seeks 0 bytes from the end of the history file. that can't be it. a grep for _LARGE_FILES doesn't reveal anything either. so where's the change? erik --------------- A new beta release, which is also a release candidate for the next full release, is available from the usual place. http://www.star.le.ac.uk/~tjg/rc/beta/rc-1.6c4.tar.gz I've appended the (short!) ChangeLog since the last beta release. I need your help to decide if this release candidate is a trick or a treat. I'm using this version (with GNU readline) on RedHat, SunOS, and Tru64. I've also built and tripped it on CygWin, Irix, NetBSD, and OpenBSD. *Particularly* if you're using a different OS than these, I need you to test out this release candidate, and let me know how it goes. But if you're using one of these, you're not excused: test it anyway, try a different line editing library, proof read some documentation... As always, your feedback makes rc better for everyone. Thanks, Tim. 2001-10-25 Feature: large file support (thanks Scott Schwartz, Chris Siebenmann). 2001-10-29 Bug: space vs tab confusion in commented out Makefile rules to rebuild parser (thanks Gary Carvell). 2001-10-31 Documentation: subscripted variables don't work in here documents. Release: rc-1.6c4. From rc-owner Thu Nov 1 14:02:25 2001 Received: from galapagos.cse.psu.edu ([130.203.12.17]) by hawkwind.utcs.utoronto.ca with SMTP id <46494>; Thu, 1 Nov 2001 14:02:15 -0500 Received: (qmail 24411 invoked by uid 991); 1 Nov 2001 17:46:10 -0000 Message-ID: <20011101174610.24409.qmail@g.bio.cse.psu.edu> To: erik quanstrom cc: rc@hawkwind.utcs.toronto.edu Subject: Re: Release candidate rc-1.6c4 available In-Reply-To: Message from erik quanstrom of "Thu, 01 Nov 2001 11:20:00 EST." <20011101162000.072423F403@quanstro.net> Date: Thu, 1 Nov 2001 12:46:10 -0500 From: Scott Schwartz Grep in /usr/include. Defining _LARGEFILE_SOURCE and/or _FILE_OFFSET_BITS=64 does magic in your system header files so that open() becomes open64(), etc. On solaris, man lf64. The failure mode is that if you have a large file, and you run rc -c 'foo ; Thu, 1 Nov 2001 14:01:39 -0500 Received: (from dalibor@localhost) by ns.caldera.de (8.11.1/8.11.1) id fA1HZ3V01247; Thu, 1 Nov 2001 18:35:03 +0100 Date: Thu, 1 Nov 2001 12:35:03 -0500 From: Stefan Dalibor To: Tim Goodwin Cc: rc@hawkwind.utcs.toronto.edu Subject: Re: Release candidate rc-1.6c4 available Message-ID: <20011101183503.A31677@caldera.de> Reply-To: dalibor@caldera.de Mail-Followup-To: Stefan Dalibor , Tim Goodwin , rc@hawkwind.utcs.toronto.edu References: <20011031161824.1422.qmail@happy.star.le.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20011031161824.1422.qmail@happy.star.le.ac.uk>; from tjg@star.le.ac.uk on Wed, Oct 31, 2001 at 11:18:24AM -0500 Hi, On Wed, Oct 31, 2001 at 11:18:24AM -0500, Tim Goodwin wrote: > A new beta release, which is also a release candidate for the next > full release, is available from the usual place. ... > I need your help to decide if this release candidate is a trick or a > treat. I'm using this version (with GNU readline) on RedHat, SunOS, > and Tru64. I've also built and tripped it on CygWin, Irix, NetBSD, > and OpenBSD. not very surprisingly, 1.6c4 builds and trips fine under OpenLinux 3.1.1, with and without GNU readline (this is Linux 2.4.9/glibc-2.2.4/gcc-2.95.2). QNX RTP 6.1.0 is a bit more problematic: These are minor: o utoa() in print.c conflicts with a library function (with different signature) - renaming rc's version of the function fixes this o test isn't delivered as standalone program with this OS, so the glob test in trip.rc for many slashes fails - this can be fixed by changing the resp. line to `sh -c 'test -f '^...' These are worse: o setrlimit() fails to inherit limits to child processes, i.e. `limit coredumpsize 0; limit coredummpsize | cat' results in `coredumpsize unlimited' - IMHO this is a bug in QNX as other shells (bash2, pdksh) show the same bug o the test for waiting for a killed process fails too - rc's wait exits w/o message (I didn't investigate this further) Aside from this, rc seems to work O.K. under QNX RTP. Stefan From rc-owner Mon Nov 5 01:05:37 2001 Received: from ptnm-sh3-port31.snet.net ([204.60.42.31]) by hawkwind.utcs.utoronto.ca with SMTP id <46576>; Mon, 5 Nov 2001 01:05:12 -0500 Received: (qmail 69537 invoked by uid 1001); 4 Nov 2001 17:58:03 -0000 Date: Sun, 4 Nov 2001 12:58:03 -0500 From: Scott Kenney To: Tim Goodwin Cc: rc@hawkwind.utcs.toronto.edu Subject: Re: Release candidate rc-1.6c4 available Message-ID: <20011104125803.A65138@hotel.rmta.org> Mail-Followup-To: Scott Kenney , Tim Goodwin , rc@hawkwind.utcs.toronto.edu References: <20011031161824.1422.qmail@happy.star.le.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20011031161824.1422.qmail@happy.star.le.ac.uk>; from tjg@star.le.ac.uk on Wed, Oct 31, 2001 at 11:18:24AM -0500 On Wed, Oct 31, 2001 at 11:18:24AM -0500, Tim Goodwin wrote: > Release: rc-1.6c4. Sorry for the late feedback. Builds and trips fine on FreeBSD ptnm-sh3-port31.snet.net 4.4-STABLE FreeBSD 4.4-STABLE #1: Sun Oct 21 08:49:21 EDT 2001 root@nrwc-sh4-port233.snet.net:/usr/obj/usr/src/sys/CONCERTINA i386 From rc-owner Wed Nov 21 14:10:33 2001 Received: from apollo.le.ac.uk ([143.210.16.125]) by hawkwind.utcs.utoronto.ca with SMTP id <52053>; Wed, 21 Nov 2001 14:08:39 -0500 Received: from happy.star.le.ac.uk ([143.210.36.58]) by apollo.le.ac.uk with smtp (Exim 3.16 #1) id 166aoD-0000J4-00 for rc@hawkwind.utcs.utoronto.ca; Wed, 21 Nov 2001 17:05:13 +0000 Received: (qmail 634 invoked from network); 21 Nov 2001 17:05:34 -0000 Received: from morpheus.star.le.ac.uk (143.210.36.121) by happy.star.le.ac.uk with QMQP; 21 Nov 2001 17:05:34 -0000 Date: Wed, 21 Nov 2001 12:05:34 -0500 Message-ID: <20011121170534.7412.qmail@happy.star.le.ac.uk> From: Tim Goodwin To: rc@hawkwind.utcs.utoronto.ca Subject: Release candidate rc-1.6c5 available A new beta release, which is also a release candidate for the next full release, is available from the usual place. http://www.star.le.ac.uk/~tjg/rc/beta/rc-1.6c5.tar.gz I've appended the ChangeLog since the last release candidate. As you can see, it's getting shorter, which means we're getting very close to the full release of rc-1.7. If you tested the last release candidate, thank you! The changes since then are so minor that you're excused testing this one (unless you're on QNX). However, if you'd like to test it anyway, please pay special attention to issues of packaging (e.g. are the instructions in the INSTALL file accurate?). If you didn't test the last release candidate, this is your last chance to help make rc-1.7 the best release of rc ever! Well, probably :-). Joking aside, I'd like to hear if rc-1.6c5 works for you, and especially if it doesn't. Thanks, Tim. 2001-11-01 Bug: more wrongly ordered header file includes (thanks Callum Gibson). 2001-11-06 Portability: rename print.c::utoa() to rc_utoa() to avoid QNX name clash; use "sh -c 'test ...'" in trip.rc for missing standalone `test' on QNX (thanks Stefan Dalibor). 2001-11-20 Documentation: tighten up various descriptions, and include some more examples. Release: rc-1.6c5. From rc-owner Fri Feb 1 23:08:23 2002 Received: from galapagos.cse.psu.edu ([130.203.12.17]) by hawkwind.utcs.toronto.edu with SMTP id <74715>; Fri, 1 Feb 2002 23:07:32 -0500 Received: (qmail 3308 invoked by uid 991); 29 Jan 2002 20:43:47 -0000 Message-ID: <20020129204347.3306.qmail@g.bio.cse.psu.edu> to: rc@hawkwind.utcs.toronto.edu Subject: solaris shells Date: Tue, 29 Jan 2002 15:43:47 -0500 From: Scott Schwartz I just noticed that Solaris 8 ships with a slew of open source shells. But not rc! We have to do something about that! From rc-owner Fri Feb 8 17:45:11 2002 Received: from apollo.le.ac.uk ([143.210.16.125]) by hawkwind.utcs.toronto.edu with SMTP id <75364>; Fri, 8 Feb 2002 17:44:53 -0500 Received: from happy.star.le.ac.uk ([143.210.36.58]) by apollo.le.ac.uk with smtp (Exim 3.16 #1) id 16ZD3H-0007jU-00 for rc@hawkwind.utcs.utoronto.ca; Fri, 08 Feb 2002 15:35:03 +0000 Received: (qmail 17901 invoked from network); 8 Feb 2002 15:35:25 -0000 Received: from fozzie.star.le.ac.uk (143.210.36.216) by happy.star.le.ac.uk with QMQP; 8 Feb 2002 15:35:25 -0000 Date: Fri, 8 Feb 2002 10:35:25 -0500 Message-ID: <20020208153525.1234.qmail@happy.star.le.ac.uk> From: Tim Goodwin To: rc@hawkwind.utcs.utoronto.ca Subject: Release candidate rc-1.6c6 available A new beta release, which is also a release candidate for the next full release, is available from the usual place. http://www.star.le.ac.uk/~tjg/rc/beta/rc-1.6c6.tar.gz I've appended the ChangeLog since the last release candidate. Further details of the changes can be found in my hacking notes: http://www.star.le.ac.uk/~tjg/rc/misc/notes You know the drill: please build and test this on as many systems as you have access to. Let me know if it works, and especially if it doesn't. Unless any problems are reported, this is the code that's going to be repackaged as rc-1.7 in a very short while. (Yes, I know that's what I said about the last two release candidates, but - hey! - that's why it's called a "release candidate".) So, please, check it out, and let me know. Thanks, Tim. 2001-11-23 Bug: parselimit() was broken in various ways (thanks Chris Siebenmann). 2002-02-08 Bug: yet more wrongly ordered header file includes. Release: rc-1.6c6. From rc-owner Wed Feb 13 14:57:24 2002 Received: from gemma.TechFak.Uni-Bielefeld.DE ([129.70.136.103]) by hawkwind.utcs.toronto.edu with SMTP id <75569>; Wed, 13 Feb 2002 14:57:17 -0500 Received: from grimsvotn.TechFak.Uni-Bielefeld.DE (grimsvotn.TechFak.Uni-Bielefeld.DE [129.70.137.40]) by gemma.TechFak.Uni-Bielefeld.DE (8.9.1/8.9.1/TechFak/pk+ro20010720) with SMTP id UAA24948 for ; Wed, 13 Feb 2002 20:21:44 +0100 (MET) Received: from localhost by grimsvotn.TechFak.Uni-Bielefeld.DE (SMI-8.6/pk19971205) id UAA01849; Wed, 13 Feb 2002 20:21:43 +0100 Message-Id: <200202131921.UAA01849@grimsvotn.TechFak.Uni-Bielefeld.DE> To: rc@hawkwind.utcs.toronto.edu Subject: non login "rc" needs customized environment X-PGP-Fingerprint: 85 89 64 AD 73 79 92 1F C8 76 95 2D 15 09 19 93 X-Organization: Uni Bielefeld, Technische Fakultaet X-Phone: +49 521 106 2902 Date: Wed, 13 Feb 2002 14:21:43 -0500 From: Peter Koch Folks, this must be a FAQ but since I did not find it in that old collection some of you may be able to shed some light on the following problem. We have been using "rc" as default login shell for more than 10 years now with currently 1000+ users in our department. Every now and then, but with increasing frequency recently we've felt uncomfortable with "rc"s handling of $HOME/.rcrc. It's only processed if "rc" is a login shell, which is not the case if you use rsh/ssh for calling commands on a remote system. Unfortunately this prevents users from customizing their environment there, especially the PATH variable. Calling "rc -l" explicitly, e.g. as in rsh foo 'rc -l ' < `{echo cmd} to enforce .rcrc processing is not always an option. Even worse, when using CVS you can ask the "cvs" command to use rsh/ssh to transparently check in/out objects on that remote system, but it needs to be able to find the appropriate "cvs" commands there, which it can't unless/before the PATH variable is set accordingly. Now "rc" users seem to lose. (There are similar scenarios, so a "cvs" only approach doesn't help, and changing the default PATH assignment also is not an option.) For these reasons we would like to trim "rc" to enable user environment customization even if "rc" is not marked as login shell. "bash" and "tcsh" support SHLVL which can be used to tell apart the top level (i.e. either login shell or first shell started by rshd/sshd) from any child or subsequent shell. So I would like to suggest to add this ``feature'' to "rc", to be activated optionally at compile time: 1) IF upon startup (SHLVL is not set or does not contain a numeric value) OR (shell is marked as login shell) THEN SHLVL=1 ELSE SHLVL++ 2) Process $HOME/.rcrc iff (sic!) SHLVL == 1 This may have backward compatibility issues with non-interactive, non-login top level shells (intentional, see above!) and also non-interactive login shells. Changing the code to accomplish this seems not too difficult, but since this is going to be an architectural change I'd like to learn other's opinions before- hand. Also, any better approach to the original problem or pointer to an existing patch would be fine. Thanks, Peter From rc-owner Wed Feb 13 16:11:34 2002 Received: from opus.INS.cwru.edu ([129.22.8.2]) by hawkwind.utcs.toronto.edu with SMTP id <75572>; Wed, 13 Feb 2002 16:11:31 -0500 Return-Path: chet@nike.ins.cwru.edu Received: from nike.ins.cwru.edu (nike.INS.CWRU.Edu [129.22.8.219]) by opus.INS.cwru.edu with SMTP (8.11.6+cwru/CWRU-3.9) id g1DKfr013005; Wed, 13 Feb 2002 15:41:53 -0500 (EST) (from chet@nike.ins.cwru.edu) Date: Wed, 13 Feb 2002 15:36:33 -0500 From: Chet Ramey To: pk@TechFak.Uni-Bielefeld.DE Subject: Re: non login "rc" needs customized environment Cc: rc@hawkwind.utcs.toronto.edu Reply-To: chet@po.CWRU.Edu Message-ID: <020213203633.AA70816.SM@nike.ins.cwru.edu> Read-Receipt-To: chet@po.CWRU.Edu MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-In-Reply-To: Message from pk@TechFak.Uni-Bielefeld.DE of Wed, 13 Feb 2002 14:21:43 -0500 (id <200202131921.UAA01849@grimsvotn.TechFak.Uni-Bielefeld.DE>) > We have been using "rc" as default login shell for more than 10 years now > with currently 1000+ users in our department. Every now and then, but > with increasing frequency recently we've felt uncomfortable with "rc"s handling > of $HOME/.rcrc. It's only processed if "rc" is a login shell, which is not > the case if you use rsh/ssh for calling commands on a remote system. > Unfortunately this prevents users from customizing their environment there, > especially the PATH variable. The environment can be modified with ssh, via ~/.ssh/environment. ssh also provides ~/.ssh/rc to run commands before the user's command is started. It's run by the user's login shell as taken from the password file. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ( ``Discere est Dolere'' -- chet) Chet Ramey, CWRU chet@po.CWRU.Edu http://cnswww.cns.cwru.edu/~chet/ From rc-owner Thu Feb 14 18:24:05 2002 Received: from galapagos.cse.psu.edu ([130.203.12.17]) by hawkwind.utcs.toronto.edu with SMTP id <75582>; Thu, 14 Feb 2002 18:22:50 -0500 Received: (qmail 28844 invoked by uid 991); 14 Feb 2002 02:16:59 -0000 Message-ID: <20020214021659.28842.qmail@g.bio.cse.psu.edu> To: chet@po.CWRU.Edu cc: pk@TechFak.Uni-Bielefeld.DE, rc@hawkwind.utcs.toronto.edu Subject: Re: non login "rc" needs customized environment In-Reply-To: Message from Chet Ramey of "Wed, 13 Feb 2002 15:36:33 EST." <020213203633.AA70816.SM@nike.ins.cwru.edu> Date: Wed, 13 Feb 2002 21:16:59 -0500 From: Scott Schwartz | The environment can be modified with ssh, via ~/.ssh/environment. ssh | also provides ~/.ssh/rc to run commands before the user's command is | started. It's run by the user's login shell as taken from the password | file. The ssh/rc thing is busted. The user's session doesn't inherit the environment it computes. From rc-owner Thu Feb 14 18:24:20 2002 Received: from shell.vex.net ([216.126.72.2]) by hawkwind.utcs.toronto.edu with SMTP id <75606>; Thu, 14 Feb 2002 18:23:56 -0500 Received: from localhost (506 bytes) by shell.vex.net via send-mail with P:stdio/R:inet_hosts/T:smtp (sender: ) (ident using unix) id for ; Thu, 14 Feb 2002 08:35:31 -0500 (EST) (Smail-3.2.0.106 1999-Mar-31 #8 built 2000-Nov-21) Message-Id: Date: Thu, 14 Feb 2002 08:35:31 -0500 From: smarry@vex.net (Smarasderagd) To: pk@TechFak.Uni-Bielefeld.DE, rc@hawkwind.utcs.toronto.edu Subject: Re: non login "rc" needs customized environment rsh should really be called rcsh; it fails miserably with any other shell. I've dealt with the rsh problem by writing a wrapper script for rsh which also deals with the fact that rc isn't on the default path on my work network, and not available as a login shell either.. From rc-owner Thu Feb 14 18:24:42 2002 Received: from harrier.prod.itd.earthlink.net ([207.217.120.12]) by hawkwind.utcs.toronto.edu with SMTP id <75618>; Thu, 14 Feb 2002 18:24:17 -0500 Received: from user-vcaun21.dsl.mindspring.com ([216.175.92.65] helo=rakitzis.com) by harrier.prod.itd.earthlink.net with esmtp (Exim 3.33 #1) id 16bPvy-0006T2-00; Thu, 14 Feb 2002 09:44:39 -0800 Received: (from byron@localhost) by rakitzis.com (8.11.0/8.11.0) id g1EHi5I04374; Thu, 14 Feb 2002 09:44:05 -0800 Date: Thu, 14 Feb 2002 12:44:05 -0500 From: Byron Rakitzis Message-Id: <200202141744.g1EHi5I04374@rakitzis.com> To: pk@TechFak.Uni-Bielefeld.DE, rc@hawkwind.utcs.toronto.edu Subject: Re: non login "rc" needs customized environment This behavior with rsh has always been a problem -- csh gets around it with .cshrc, and I wonder if some similar solution might be necessary for backward compatability. I love the SHLVL hack, but if you put it in place, then rc will now process .rcrc differently across different versions of the shell, and I'd prefer some backward compatability if at all possible. I think it's a good topic for discussion though. Byron. From rc-owner Thu Feb 14 18:37:18 2002 Received: from faui02.informatik.uni-erlangen.de ([131.188.30.102]) by hawkwind.utcs.toronto.edu with SMTP id <75634>; Thu, 14 Feb 2002 18:37:13 -0500 Received: (from msfriedl@localhost) by faui02.informatik.uni-erlangen.de (8.9.1/8.1.16-FAU) id AAA12881; Fri, 15 Feb 2002 00:35:29 +0100 (MET) Date: Thu, 14 Feb 2002 18:35:29 -0500 From: Markus Friedl To: Scott Schwartz Cc: chet@po.CWRU.Edu, pk@TechFak.Uni-Bielefeld.DE, rc@hawkwind.utcs.toronto.edu Subject: Re: non login "rc" needs customized environment Message-ID: <20020214233528.GA12787@faui02> References: <020213203633.AA70816.SM@nike.ins.cwru.edu> <20020214021659.28842.qmail@g.bio.cse.psu.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020214021659.28842.qmail@g.bio.cse.psu.edu> User-Agent: Mutt/1.3.25i On Wed, Feb 13, 2002 at 09:16:59PM -0500, Scott Schwartz wrote: > | The environment can be modified with ssh, via ~/.ssh/environment. ssh > | also provides ~/.ssh/rc to run commands before the user's command is > | started. It's run by the user's login shell as taken from the password > | file. > > The ssh/rc thing is busted. The user's session doesn't inherit > the environment it computes. yes, but sshd behaves like this since 1995, and it's not always a good idea to change the default behaviour. From rc-owner Thu Feb 14 22:07:09 2002 Received: from sarg.ryerson.ca ([141.117.18.117]) by hawkwind.utcs.toronto.edu with SMTP id <75606>; Thu, 14 Feb 2002 22:07:07 -0500 Received: from sarg.ryerson.ca (dmason@localhost) by sarg.ryerson.ca (8.11.2/8.11.2) with ESMTP id g1F0Ixx22217 for ; Thu, 14 Feb 2002 19:18:59 -0500 Message-Id: <200202150018.g1F0Ixx22217@sarg.ryerson.ca> To: rc@hawkwind.utcs.toronto.edu Subject: Re: non login "rc" needs customized environment In-reply-to: Your message of "Thu, 14 Feb 2002 12:44:05 EST." <200202141744.g1EHi5I04374@rakitzis.com> User-Agent: EMH/1.10.0 SEMI/1.13.7 (Awazu) CLIME/1.13.6 (=?ISO-2022-JP?B?GyRCQ2YlTj4xGyhC?=) MULE XEmacs/21.1 (patch 14) (Cuyahoga Valley) (alpha-redhat-linux) MIME-Version: 1.0 (generated by SEMI 1.13.7 - "Awazu") Content-Type: text/plain; charset=US-ASCII Date: Thu, 14 Feb 2002 19:18:59 -0500 From: Dave Mason Back when I used rc, I ran a patched version that understood the -C switch that csh gets from rsh, and basically did the same thing. It wasn't necessarily pretty, but it worked. ../Dave From rc-owner Thu Feb 14 22:07:11 2002 Received: from most.weird.com ([204.92.254.2]) by hawkwind.utcs.toronto.edu with SMTP id <75634>; Thu, 14 Feb 2002 22:07:07 -0500 Received: from proven.weird.com([204.92.254.15]) (1819 bytes) by most.weird.com via smail with P:esmtp/R:bind_hosts/T:inet_zone_bind_smtp (sender: ) (ident <[ubyUg06SyksgOHSe6sPAN/E7uX1Va0vIaU9Hln8yjo8i3MXXWKpKYLz4yKeklGyEKiwmHpx6ReVOVr2BMyuYqg==]> using rfc1413) id for ; Thu, 14 Feb 2002 19:37:31 -0500 (EST) (Smail-3.2.0.115-Pre 2001-Aug-6 #39 built 2002-Feb-7) Received: by proven.weird.com (Postfix, from userid 1000) id 3C159B5; Thu, 14 Feb 2002 19:37:26 -0500 (EST) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit From: woods@weird.com (Greg A. Woods) To: rc@hawkwind.utcs.toronto.edu Subject: Re: non login "rc" needs customized environment In-Reply-To: References: X-Mailer: VM 7.00 under Emacs 21.1.1 Reply-To: rc@hawkwind.utcs.toronto.edu Organization: Planix, Inc.; Toronto, Ontario; Canada Message-Id: <20020215003726.3C159B5@proven.weird.com> Date: Thu, 14 Feb 2002 19:37:26 -0500 [ On Thursday, February 14, 2002 at 08:35:31 (-0500), Smarasderagd wrote: ] > Subject: Re: non login "rc" needs customized environment > > rsh should really be called rcsh; it fails miserably with any other > shell. Rsh works perfectly well with any and every shell. With ksh and its clones though there are better ways of setting up a per-user specified environment, just as with csh.... The reason is of course that csh and ksh have a default way of reading a script specified by the environment variable ENV, which has a default value specified at compile time.... (in pdksh you have to define DEFAULT_ENV at compile time to enable a default ENV script....) Perhaps 'rc' could use a similar technique. -- Greg A. Woods +1 416 218-0098; ; ; Planix, Inc. ; VE3TCP; Secrets of the Weird From rc-owner Thu Feb 14 22:07:14 2002 Received: from galapagos.cse.psu.edu ([130.203.12.17]) by hawkwind.utcs.toronto.edu with SMTP id <75640>; Thu, 14 Feb 2002 22:07:07 -0500 Received: (qmail 14030 invoked by uid 991); 15 Feb 2002 03:05:04 -0000 Message-ID: <20020215030504.14028.qmail@g.bio.cse.psu.edu> To: Markus Friedl cc: rc@hawkwind.utcs.toronto.edu Subject: Re: non login "rc" needs customized environment In-Reply-To: Message from Markus Friedl of "Fri, 15 Feb 2002 00:35:29 +0100." <20020214233528.GA12787@faui02> Date: Thu, 14 Feb 2002 22:05:04 -0500 From: Scott Schwartz Markus writes: | yes, but sshd behaves like this since 1995, and it's not | always a good idea to change the default behaviour. True. But we could add a new mechanism which would be able to compute the environment for the session. From rc-owner Thu Feb 14 22:22:26 2002 Received: from galapagos.cse.psu.edu ([130.203.12.17]) by hawkwind.utcs.toronto.edu with SMTP id <48116>; Thu, 14 Feb 2002 22:22:22 -0500 Received: (qmail 14311 invoked by uid 991); 15 Feb 2002 03:21:29 -0000 Message-ID: <20020215032129.14309.qmail@g.bio.cse.psu.edu> To: Byron Rakitzis cc: pk@TechFak.Uni-Bielefeld.DE, rc@hawkwind.utcs.toronto.edu Subject: Re: non login "rc" needs customized environment In-Reply-To: Message from Byron Rakitzis of "Thu, 14 Feb 2002 12:44:05 EST." <200202141744.g1EHi5I04374@rakitzis.com> Date: Thu, 14 Feb 2002 22:21:29 -0500 From: Scott Schwartz | This behavior with rsh has always been a problem -- csh gets around | it with .cshrc, and I wonder if some similar solution might be necessary | for backward compatability. Take a look at what zsh does. There are lots of cases one might want to handle, once you start in with different config files: STARTUP/SHUTDOWN FILES Commands are first read from /etc/zshenv. If the RCS option is unset within /etc/zshenv, all other initialization files are skipped. Otherwise, commands are read from $ZDOTDIR/.zshenv. (If ZDOTDIR is unset, HOME is used instead). If the first character of argument zero passed to the shell is -, or if the -l flag is present, then the shell is assumed to be a login shell, and commands are read from /etc/zprofile and then $ZDOTDIR/.zprofile. Then, if the shell is interactive, commands are read from /etc/zshrc and then $ZDOTDIR/.zshrc. Finally, if the shell is a login shell, /etc/zlogin and $ZDOTDIR/.zlogin are read. | I love the SHLVL hack, but if you put it in place, then rc will now | process .rcrc differently across different versions of the shell, and | I'd prefer some backward compatability if at all possible. SHLVL leaves me cold. The issue is how to tell a shell to do some initialization---nesting level should be conceptually infinite, and shouldn't effect that. From rc-owner Thu Feb 14 23:12:45 2002 Received: from goose.prod.itd.earthlink.net ([207.217.120.18]) by hawkwind.utcs.toronto.edu with SMTP id <48116>; Thu, 14 Feb 2002 23:12:39 -0500 Received: from user-vcaun21.dsl.mindspring.com ([216.175.92.65] helo=rakitzis.com) by goose.prod.itd.earthlink.net with esmtp (Exim 3.33 #1) id 16bZig-0002jF-00; Thu, 14 Feb 2002 20:11:34 -0800 Received: (from byron@localhost) by rakitzis.com (8.11.0/8.11.0) id g1F4BTn06392; Thu, 14 Feb 2002 20:11:29 -0800 Date: Thu, 14 Feb 2002 23:11:29 -0500 From: Byron Rakitzis Message-Id: <200202150411.g1F4BTn06392@rakitzis.com> To: byron@rakitzis.com, schwartz@bio.cse.psu.edu Subject: Re: non login "rc" needs customized environment Cc: pk@TechFak.Uni-Bielefeld.DE, rc@hawkwind.utcs.toronto.edu >Take a look at what zsh does. There are lots of cases one might >want to handle, once you start in with different config files: Hey, my rc did away with the system-wide rcrc implied in Duff's paper. All I'm saying is that you don't necessarily want .rcrc to run via rsh -- there might be stuff in there that depends on an interactive shell. Hence the suggestion that a different mechanism be used. That being said, I like to use stricter rules for my personal .rcrc: it is idempotent, so I can always issue ". .rcrc" and be sure there won't be any nonsense in my environment. Byron. From rc-owner Tue Feb 26 19:38:25 2002 Received: from apollo.le.ac.uk ([143.210.16.125]) by hawkwind.utcs.toronto.edu with SMTP id <75662>; Tue, 26 Feb 2002 19:37:20 -0500 Received: from happy.star.le.ac.uk ([143.210.36.58]) by apollo.le.ac.uk with smtp (Exim 3.16 #1) id 16biyE-0004R9-00 for rc@hawkwind.utcs.toronto.edu; Fri, 15 Feb 2002 14:04:14 +0000 Received: (qmail 9223 invoked from network); 15 Feb 2002 14:04:36 -0000 Received: from fozzie.star.le.ac.uk (143.210.36.216) by happy.star.le.ac.uk with QMQP; 15 Feb 2002 14:04:36 -0000 Date: Fri, 15 Feb 2002 09:04:36 -0500 Message-ID: <20020215140436.28162.qmail@happy.star.le.ac.uk> From: Tim Goodwin To: rc@hawkwind.utcs.toronto.edu In-reply-to: <200202150411.g1F4BTn06392@rakitzis.com> (byron@rakitzis.com) Subject: Re: non login "rc" needs customized environment References: <200202150411.g1F4BTn06392@rakitzis.com> My thoughts on this subject. 1. First and foremost, my focus at the moment is on getting rc-1.7 out the door. Whatever we conclude on this issue, I'm not making any changes before then. (So far, nobody's reported any problems with rc-1.6c6; if you've found any, please tell me ASAP!) 2. I agree that there is a real problem here (although we've all managed to muddle along somehow till now). 3. Any solution must be simple. If you want zsh, you know where to find it :-). (The other heavyweight shells, such as bash and tcsh, have also gone down the "twisty little maze of startup files" route; rc will not. Promise.) 4. I'm not at all keen to introduce any more compile-time options. This implies that we must seek a solution which is acceptable to everybody (or almost everybody). 5. I'm keeping a note of the various ideas that have been suggested. When the discussion dries up (or descends into flamefest), I'll post a summary. Tim. From rc-owner Tue Feb 26 21:06:44 2002 Received: from imr1.aus.deuba.com ([203.0.62.7]) by hawkwind.utcs.toronto.edu with SMTP id <75644>; Tue, 26 Feb 2002 21:06:44 -0500 Received: from bmr1-e1.aus.deuba.com by imr1.aus.deuba.com id g1R1kOhL028917; Wed, 27 Feb 2002 12:46:24 +1100 (EST) Received: from mailhost.aus.deuba.com by bmr1-e1.aus.deuba.com id g1R1kNcK005477; Wed, 27 Feb 2002 12:46:24 +1100 (EST) Received: from merton.aus.deuba.com (merton.aus.deuba.com [10.179.88.22]) by mailhost.aus.deuba.com (8.9.1/8.9.1) with SMTP id MAA09747 for ; Wed, 27 Feb 2002 12:46:23 +1100 (EST) Received: (qmail 10431 invoked by uid 107); 27 Feb 2002 01:46:23 -0000 Message-ID: <20020227014623.10430.qmail@merton.aus.deuba.com> From: callum.gibson@db.com Subject: Re: non login "rc" needs customized environment To: rc@hawkwind.utcs.utoronto.ca (rc Shell) Date: Tue, 26 Feb 2002 20:46:23 -0500 In-Reply-To: <20020215140436.28162.qmail@happy.star.le.ac.uk> from "tjg@star.le.ac.uk" at Feb 15, 2002 09:04:36 AM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit tjg@star.le.ac.uk writes: }4. I'm not at all keen to introduce any more compile-time options. } This implies that we must seek a solution which is acceptable to } everybody (or almost everybody). It seems to me the default is backwards. Due to rc being invoked from various place over which you may not have control (and hence can't add the -l flag), rc should by default read .rcrc (or something). It is easy to avoid reading it by adding a test to the first line, eg. (using the level count variable someone suggested): ~ $rclvl () && { rclvl=1 #rest of your usual .rcrc - put it in a file if you want and source it #like this . .rclogin } || { rclvl=`{expr $rclvl + 1} # other stuff you might want to do every time. } We don't need a maze of twisty dot files, just one which is always read. Since rc stuffs everything in environment variables things are inherited by sub-rc-shells anyway, including functions. Of course, the major problem is that this isn't backwards compatible. What it _does_ allow is a choice between whether you get the startup files or not, which the current default does not allow for. C (c)2002 Callum Gibson callum.gibson@db.com Global Markets IT, Deutsche Bank, Australia 61 2 9258 1620 ### The opinions in this message are mine and not Deutsche's ### From rc-owner Tue Feb 26 21:06:46 2002 Received: from albatross.prod.itd.earthlink.net ([207.217.120.120]) by hawkwind.utcs.toronto.edu with SMTP id <75642>; Tue, 26 Feb 2002 21:06:43 -0500 Received: from user-vcaunld.dsl.mindspring.com ([216.175.94.173] helo=rakitzis.com) by albatross.prod.itd.earthlink.net with esmtp (Exim 3.33 #1) id 16fsKe-0004MD-00; Tue, 26 Feb 2002 16:52:32 -0800 Received: (from byron@localhost) by rakitzis.com (8.11.0/8.11.0) id g1R0qNS28877; Tue, 26 Feb 2002 16:52:23 -0800 Date: Tue, 26 Feb 2002 19:52:23 -0500 From: Byron Rakitzis Message-Id: <200202270052.g1R0qNS28877@rakitzis.com> To: rc@hawkwind.utcs.toronto.edu, tjg@star.le.ac.uk Subject: Re: non login "rc" needs customized environment Okay, here's a suggestion. What if by default a non-interactive rc executes .rcrc, but it does so implicitly with the -n flag set. Then, we need a builtin to be able to turn off -n, so that the non- interactive portions of .rcrc might be interpreted. Finally, there also then needs to be a mechanism for avoiding the infinite recursion of .rcrc's. An example .rcrc: # # Non-interactive stuff goes here # exec +n # made-up builtin path=(/a/bin /b/bin /c/bin) # # Interactive stuff goes here # exec -n # made-up builtin stty dec It's convoluted because I want rc to preserve compatability with the old .rcrc semantics: i.e., I want an old .rcrc to work properly even via rsh. Maybe this is a holy grail not worth pursuing since who likes the old semantics of rsh anyway? Byron. From rc-owner Tue Feb 26 21:16:19 2002 Received: from localhost by hawkwind.utcs.toronto.edu with SMTP id <75678>; Tue, 26 Feb 2002 21:16:09 -0500 To: rc@hawkwind.utcs.utoronto.ca (rc Shell) Subject: Re: non login "rc" needs customized environment In-reply-to: Your message of "Tue, 26 Feb 2002 20:46:23 EST." <20020227014623.10430.qmail@merton.aus.deuba.com> Date: Tue, 26 Feb 2002 21:16:03 -0500 From: Chris Siebenmann Message-Id: <02Feb26.211609edt.75678@hawkwind.utcs.toronto.edu> | It seems to me the default is backwards. Due to rc being invoked from | various place over which you may not have control (and hence can't add | the -l flag), rc should by default read .rcrc (or something). It is easy | to avoid reading it by adding a test to the first line, eg. (using the | level count variable someone suggested): Consulting .rcrc for every new shell requires reading and parsing all of it on every semi-interactive subshell. (The same is true for any other file rc would be looking at, of course.) I spawn a lot of copies of rc over the course of my day. I'm not really enthused about adding this overhead (and this dependancy on $home responding right now) to them. This is a long way to go just because rsh (and ssh) have problems that can easily be fixed via wrappers. - cks From rc-owner Wed Feb 27 01:19:03 2002 Received: from cisco.com ([144.254.112.76]) by hawkwind.utcs.toronto.edu with SMTP id <76096>; Wed, 27 Feb 2002 01:18:58 -0500 Received: (from dfawcus@localhost) by cisco.com (8.8.8/2.6/Cisco List Logging/8.8.8) id GAA06993; Wed, 27 Feb 2002 06:13:02 GMT Date: Wed, 27 Feb 2002 01:13:02 -0500 From: Derek Fawcus To: Byron Rakitzis Cc: schwartz@bio.cse.psu.edu, pk@TechFak.Uni-Bielefeld.DE, rc@hawkwind.utcs.toronto.edu Subject: Re: non login "rc" needs customized environment Message-ID: <20020227061302.B5979@edinburgh.cisco.com> Mail-Followup-To: Byron Rakitzis , schwartz@bio.cse.psu.edu, pk@TechFak.Uni-Bielefeld.DE, rc@hawkwind.utcs.toronto.edu References: <200202150411.g1F4BTn06392@rakitzis.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: <200202150411.g1F4BTn06392@rakitzis.com>; from byron@rakitzis.com on Thu, Feb 14, 2002 at 11:11:29PM -0500 On Thu, Feb 14, 2002 at 11:11:29PM -0500, Byron Rakitzis wrote: > > All I'm saying is that you don't necessarily want .rcrc to run via rsh -- > there might be stuff in there that depends on an interactive shell. Hence > the suggestion that a different mechanism be used. > > That being said, I like to use stricter rules for my personal .rcrc: > it is idempotent, so I can always issue ". .rcrc" and be sure there > won't be any nonsense in my environment. Add a flag (say -S) which when used as 'rc -S file' will act as if ". file" had been the first command executed. I've been thinking of hacking this into my copy of rc, just so that when starting xterms I can be lasy and forgo typing '. .rc/interactive' into every new shell. This could then be used with "ssh -t host 'rc -S startup_file'" from the originating host if a specific environment set up is required. I quite _like_ the fact that I can get an virgin environment when logging in remotely. In fact the above could be hidden by having a _local_ wrapper for ssh which played the above games when logging into the remote system. Alternately since ssh can pass environment strings across to the remote process, simply set the environment you need for rc at your local end and allow this to inititialise the remote rc. DF From rc-owner Wed Feb 27 01:27:34 2002 Received: from plan9.cs.bell-labs.com ([204.178.31.2]) by hawkwind.utcs.toronto.edu with SMTP id <76097>; Wed, 27 Feb 2002 01:27:31 -0500 Received: from plan9.cs.bell-labs.com ([135.104.9.2]) by plan9; Wed Feb 27 01:26:16 EST 2002 Received: from plan9.cs.bell-labs.com ([141.154.234.126]) by plan9; Wed Feb 27 01:26:14 EST 2002 Message-ID: <0dd80d6ff918424807184c4f650c5424@plan9.bell-labs.com> To: rc@hawkwind.utcs.toronto.edu Subject: Re: non login "rc" needs customized environment From: "Russ Cox" Date: Wed, 27 Feb 2002 01:26:13 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit > Add a flag (say -S) which when used as 'rc -S file' will act as if ". file" > had been the first command executed. I've been thinking of hacking this > into my copy of rc, just so that when starting xterms I can be lasy and > forgo typing '. .rc/interactive' into every new shell. > > This could then be used with "ssh -t host 'rc -S startup_file'" from the > originating host if a specific environment set up is required. I quite Even easier, just use ssh -t host 'rc -c ''. startup_file; . -i /dev/stdin'''. From rc-owner Wed Feb 27 01:34:30 2002 Received: from hawk.mail.pas.earthlink.net ([207.217.120.22]) by hawkwind.utcs.toronto.edu with SMTP id <76096>; Wed, 27 Feb 2002 01:34:22 -0500 Received: from user-vcaunld.dsl.mindspring.com ([216.175.94.173] helo=rakitzis.com) by hawk.mail.pas.earthlink.net with esmtp (Exim 3.33 #1) id 16fxb3-00076b-00; Tue, 26 Feb 2002 22:29:49 -0800 Received: (from byron@localhost) by rakitzis.com (8.11.0/8.11.0) id g1R6TV429512; Tue, 26 Feb 2002 22:29:31 -0800 Date: Wed, 27 Feb 2002 01:29:31 -0500 From: Byron Rakitzis Message-Id: <200202270629.g1R6TV429512@rakitzis.com> To: byron@rakitzis.com, dfawcus@cisco.com Subject: Re: non login "rc" needs customized environment Cc: pk@TechFak.Uni-Bielefeld.DE, rc@hawkwind.utcs.toronto.edu, schwartz@bio.cse.psu.edu > Add a flag (say -S) which when used as 'rc -S file' will act as if ". file" > had been the first command executed. I've been thinking of hacking this > into my copy of rc, just so that when starting xterms I can be lasy and > forgo typing '. .rc/interactive' into every new shell. > This could then be used with "ssh -t host 'rc -S startup_file'" from the > originating host if a specific environment set up is required. I quite > _like_ the fact that I can get an virgin environment when logging in > remotely. I am not sure I understand the ssh problem described here. My understanding was that this is a problem with NON-interactive shells. As long as you are willing to play games with wrappers and so on and so forth, why not simply do: rsh foo 'rc -c ''. .rcrc; '$^cmd'''' Incidentally, a good way of getting an interactive shell to do something just once, e.g., when starting a new xterm, is to set fn prompt as follows: fn prompt { fn prompt # remove myself from the environment one-time init stuff } This works differently from .rcrc because it could be, for example, that your .xinitrc runs rc as a login shell, but only when a subshell finally prints a prompt do you do things like set a terminal type, etc. Byron. From rc-owner Wed Feb 27 15:18:55 2002 Received: from mail.strozzi.it ([80.105.103.166]) by hawkwind.utcs.toronto.edu with SMTP id <76123>; Wed, 27 Feb 2002 15:18:35 -0500 Received: from carlos by mail.strozzi.it with local (Exim 3.12 #1 (Debian)) id 16g48t-0001bx-00; Wed, 27 Feb 2002 14:29:11 +0100 Date: Wed, 27 Feb 2002 08:29:11 -0500 From: Carlo Strozzi To: rc@hawkwind.utcs.toronto.edu Subject: Re: non login "rc" needs customized environment Message-ID: <20020227142911.H350@texne.com> Mail-Followup-To: Carlo Strozzi , rc@hawkwind.utcs.toronto.edu References: <200202150411.g1F4BTn06392@rakitzis.com> <20020215140436.28162.qmail@happy.star.le.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20020215140436.28162.qmail@happy.star.le.ac.uk>; from tjg@star.le.ac.uk on Fri, Feb 15, 2002 at 09:04:36AM -0500 Organization: ScriptaWorks.COM On Fri, Feb 15, 2002 at 09:04:36AM -0500, Tim Goodwin wrote: > > 3. Any solution must be simple. If you want zsh, you know where to > find it :-). (The other heavyweight shells, such as bash and tcsh, > have also gone down the "twisty little maze of startup files" > route; rc will not. Promise.) Thanks God :-) -- For easier reading please set the Courier font. Messages larger than 30 KB may not receive immediate attention. Freedom for Business: http://swpat.ffii.org From rc-owner Wed Feb 27 15:18:56 2002 Received: from mail.strozzi.it ([80.105.103.166]) by hawkwind.utcs.toronto.edu with SMTP id <76124>; Wed, 27 Feb 2002 15:18:49 -0500 Received: from carlos by mail.strozzi.it with local (Exim 3.12 #1 (Debian)) id 16g4Bz-0001cJ-00; Wed, 27 Feb 2002 14:32:23 +0100 Date: Wed, 27 Feb 2002 08:32:23 -0500 From: Carlo Strozzi To: rc Shell Subject: Re: non login "rc" needs customized environment Message-ID: <20020227143223.I350@texne.com> Mail-Followup-To: Carlo Strozzi , rc Shell References: <20020227014623.10430.qmail@merton.aus.deuba.com> <02Feb26.211609edt.75678@hawkwind.utcs.toronto.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <02Feb26.211609edt.75678@hawkwind.utcs.toronto.edu>; from cks@hawkwind.utcs.toronto.edu on Tue, Feb 26, 2002 at 09:16:03PM -0500 Organization: ScriptaWorks.COM On Tue, Feb 26, 2002 at 09:16:03PM -0500, Chris Siebenmann wrote: > > Consulting .rcrc for every new shell requires reading and parsing all > of it on every semi-interactive subshell. (The same is true for any > other file rc would be looking at, of course.) > > I spawn a lot of copies of rc over the course of my day. I'm not > really enthused about adding this overhead (and this dependancy on > $home responding right now) to them. I use rc heavily for Web scripting, so it would be even more of a problem. Please do not go that way. carlo -- For easier reading please set the Courier font. Messages larger than 30 KB may not receive immediate attention. Freedom for Business: http://swpat.ffii.org From rc-owner Thu Feb 28 01:12:32 2002 Received: from pc1-dale5-0-cust136.not.cable.ntl.com ([80.1.77.139]) by hawkwind.utcs.toronto.edu with SMTP id <74985>; Thu, 28 Feb 2002 01:11:48 -0500 Received: (qmail 38546 invoked from network); 27 Feb 2002 22:24:56 -0000 Received: from localhost (HELO matt.thebigchoice.com) (127.0.0.1) by localhost with SMTP; 27 Feb 2002 22:24:56 -0000 Date: Wed, 27 Feb 2002 17:24:56 -0500 From: Matt H To: rc@hawkwind.utcs.toronto.edu Subject: Re: non login "rc" needs customized environment Message-Id: <20020227222456.1110e2b2.matt@proweb.co.uk> In-Reply-To: <20020227142911.H350@texne.com> References: <200202150411.g1F4BTn06392@rakitzis.com> <20020215140436.28162.qmail@happy.star.le.ac.uk> <20020227142911.H350@texne.com> X-Mailer: Sylpheed version 0.7.2 (GTK+ 1.2.10; i386-portbld-freebsd4.4) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit > > have also gone down the "twisty little maze of startup files" > > route; rc will not. Promise.) > > Thanks God :-) I'm not much of a me too guy but "ME TOO" by all means offer extra startup stuff as some sort of option but rapid startup time is one of the reasons (among many) I use rc ta From rc-owner Thu Mar 14 17:43:18 2002 Received: from quanstro.net ([66.92.161.167]) by hawkwind.utcs.toronto.edu with SMTP id <8797>; Thu, 14 Mar 2002 17:43:06 -0500 Received: by quanstro.net (Postfix, from userid 210) id 003CB3F40B; Thu, 14 Mar 2002 17:37:15 -0500 (EST) To: rc@hawkwind.utcs.toronto.edu From: erik quanstrom Subject: rc 1.6 $version Message-Id: <20020314223715.003CB3F40B@quanstro.net> Date: Thu, 14 Mar 2002 17:37:15 -0500 is there any way that $version could be changed either to not be so magic (i.e. assigned at startup time) or better something like _rc_version_. i have been discovering scripts that no longer work with rc 1.6 ever since i installed it because they were assigning to $version and expecting the same value back. silly me. erik From rc-owner Wed Mar 27 15:24:58 2002 Received: from apollo.le.ac.uk ([143.210.16.125]) by hawkwind.utcs.toronto.edu with SMTP id <9382>; Wed, 27 Mar 2002 15:24:31 -0500 Received: from happy.star.le.ac.uk ([143.210.36.58]) by apollo.le.ac.uk with smtp (Exim 3.16 #1) id 16qDS3-0006vT-00 for rc@hawkwind.utcs.toronto.edu; Wed, 27 Mar 2002 13:26:55 +0000 Received: (qmail 15075 invoked from network); 27 Mar 2002 13:27:16 -0000 Received: from fozzie.star.le.ac.uk (143.210.36.216) by happy.star.le.ac.uk with QMQP; 27 Mar 2002 13:27:16 -0000 Date: Wed, 27 Mar 2002 08:27:16 -0500 Message-ID: <20020327132716.23114.qmail@happy.star.le.ac.uk> From: Tim Goodwin To: quanstro@speakeasy.net CC: rc@hawkwind.utcs.toronto.edu In-reply-to: <20020314223715.003CB3F40B@quanstro.net> Subject: Re: rc 1.6 $version References: <20020314223715.003CB3F40B@quanstro.net> > is there any way that $version could be changed either > to not be so magic (i.e. assigned at startup time) or > better something like _rc_version_. The `version' variable was introduced in rc-1.6b1 (replacing the `-V' flag, which itself was new in rc-1.5b4). Thus, it's never been in a full release. Thus, I'm prepared to change it :-). Any objections to `rc_version'? Tim. From rc-owner Wed Mar 27 18:08:20 2002 Received: from mail.strozzi.it ([80.105.103.166]) by hawkwind.utcs.toronto.edu with SMTP id <9416>; Wed, 27 Mar 2002 18:08:03 -0500 Received: from carlos by mail.strozzi.it with local (Exim 3.12 #1 (Debian)) id 16qKiY-0001Db-00; Wed, 27 Mar 2002 22:12:26 +0100 Date: Wed, 27 Mar 2002 16:12:26 -0500 From: Carlo Strozzi To: rc@hawkwind.utcs.toronto.edu Subject: Re: rc 1.6 $version Message-ID: <20020327221226.A25153@strozzi.it> Mail-Followup-To: Carlo Strozzi , rc@hawkwind.utcs.toronto.edu References: <20020314223715.003CB3F40B@quanstro.net> <20020327132716.23114.qmail@happy.star.le.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20020327132716.23114.qmail@happy.star.le.ac.uk>; from tjg@star.le.ac.uk on Wed, Mar 27, 2002 at 08:27:16AM -0500 Organization: ScriptaWorks.COM On Wed, Mar 27, 2002 at 08:27:16AM -0500, Tim Goodwin wrote: > > is there any way that $version could be changed either > > to not be so magic (i.e. assigned at startup time) or > > better something like _rc_version_. > > The `version' variable was introduced in rc-1.6b1 (replacing the `-V' > flag, which itself was new in rc-1.5b4). Thus, it's never been in a > full release. Thus, I'm prepared to change it :-). > > Any objections to `rc_version'? rc already has a few reserved variable names, like $pid, $bqstatus, $status, and so on. Others, like $version, could be added in the future. It would be nice to have a naming-convention for reserved names, so that one knows in advance what names should be left alone. The proposed `rc_version' is ok, and my suggestion is to set the `rc_' prefix aside for rc reserved variables. We would then have rc_path, rc_home, rc_whatever. Of course, for backward compatibility we will continue to have also $pid, $path and that, but from now on there whould at least be a standard for any new rc needs, and that could be documented in the man page. Since rc supports 'funny' characters in names, the reserved ones could even be 'rc.something', so that they are even more peculiar. Just my two-cent. bye, carlo -- For easier reading please set the Courier font. Messages larger than 30 KB may not receive immediate attention. Freedom for Business: http://swpat.ffii.org From rc-owner Sat Mar 30 17:04:29 2002 Received: from dmul.paulhaahr.com ([63.203.198.9]) by hawkwind.utcs.toronto.edu with SMTP id <75151>; Sat, 30 Mar 2002 17:04:24 -0500 Received: (qmail 2005 invoked by uid 500); 30 Mar 2002 18:43:31 -0000 Message-Id: <8ZFwtjf51i@dmul.paulhaahr.com> Date: Sat, 30 Mar 2002 13:43:31 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit From: Paul Haahr To: rc@hawkwind.utcs.toronto.edu Subject: Re: rc 1.6 $version In-Reply-To: <20020327221226.A25153@strozzi.it> References: <20020314223715.003CB3F40B@quanstro.net> <20020327132716.23114.qmail@happy.star.le.ac.uk> <20020327221226.A25153@strozzi.it> X-Mailer: VM 6.30 under Emacs 20.7.1 Tim wrote > Any objections to `rc_version'? I'd prefer $rc-version, but either should be fine. However, making it such a magic variable feels silly. As Eric noted, having assignments to a variable just be eaten without warning seems, er, surprising at best. Why not just initialize version (provided there's none set in the environment?), not export it, and have any assignments turn it into a normal variable. I think that's pretty easy to do. Carlo wrote: > rc already has a few reserved variable names, like $pid, $bqstatus, > $status [...] and my suggestion is to set the `rc_' prefix aside for > rc reserved variables. We would then have rc_path, rc_home, > rc_whatever. Of course, for backward compatibility we will continue to > have also $pid, $path and that, but from now on there whould at least > be a standard for any new rc needs, and that could be documented in > the man page. No! No! No! I understand why one might want to prefix ``version'' -- this is rc's version, not a system-wide version -- but your path, home directory, etc, are exported and global properties. (The path/PATH distinction, etc, is just backwards compatibility, after all.) One of the points of rc is that it uses so few special variables that we don't need special namespaces. --p From rc-owner Wed Apr 3 15:00:53 2002 Received: from mail.strozzi.it ([80.105.103.166]) by hawkwind.utcs.toronto.edu with SMTP id <75921>; Wed, 3 Apr 2002 15:00:26 -0500 Received: from carlos by mail.strozzi.it with local (Exim 3.12 #1 (Debian)) id 16rh1r-0000BZ-00; Sun, 31 Mar 2002 17:13:59 +0200 Date: Sun, 31 Mar 2002 10:13:58 -0500 From: Carlo Strozzi To: rc@hawkwind.utcs.toronto.edu Subject: Re: rc 1.6 $version Message-ID: <20020331171358.A604@strozzi.it> Mail-Followup-To: Carlo Strozzi , rc@hawkwind.utcs.toronto.edu References: <20020314223715.003CB3F40B@quanstro.net> <20020327132716.23114.qmail@happy.star.le.ac.uk> <20020327221226.A25153@strozzi.it> <8ZFwtjf51i@dmul.paulhaahr.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <8ZFwtjf51i@dmul.paulhaahr.com>; from paul@paulhaahr.com on Sat, Mar 30, 2002 at 01:43:31PM -0500 Organization: ScriptaWorks.COM On Sat, Mar 30, 2002 at 01:43:31PM -0500, Paul Haahr wrote: > > Why not just initialize version (provided there's none set in the > environment?), not export it, and have any assignments turn it into a > normal variable. I think that's pretty easy to do. This certainly makes sense, I agree. Just forget about my proposed special `rc_' namespace. -cs- -- For easier reading please set the Courier font. Messages larger than 30 KB may not receive immediate attention. Freedom for Business: http://swpat.ffii.org From rc-owner Wed Apr 3 15:00:57 2002 Received: from dmul.paulhaahr.com ([63.203.198.9]) by hawkwind.utcs.toronto.edu with SMTP id <9638>; Wed, 3 Apr 2002 15:00:51 -0500 Received: (qmail 28706 invoked by uid 500); 3 Apr 2002 15:06:47 -0000 Message-Id: Date: Wed, 3 Apr 2002 10:06:47 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit From: Paul Haahr To: Tim Goodwin Cc: rc@hawkwind.utcs.toronto.edu Subject: Re: rc 1.6 $version In-Reply-To: <20020403143130.22327.qmail@happy.star.le.ac.uk> References: <20020314223715.003CB3F40B@quanstro.net> <20020327132716.23114.qmail@happy.star.le.ac.uk> <20020327221226.A25153@strozzi.it> <8ZFwtjf51i@dmul.paulhaahr.com> <20020403143130.22327.qmail@happy.star.le.ac.uk> X-Mailer: VM 6.30 under Emacs 20.7.1 Tim wrote > > I'd prefer $rc-version, but either should be fine. > > (As it turns out, this is all irrelevant, but I have would two > objections to this. First, `-' turns on free careting, [...] Yeah, I forgot about that. (We had fixed that in es.) > Secondly, rc is meant to be C-ish, not Lisp-ish.) That, too, we fixed in es. > Mea culpa. I failed to realise that there are two types of special > variable in rc: 1) those that merely have a default initial value, and > 2) those that invoke special code when substituted. Till now, > $version was in category 2. I've just moved it to category 1. This seems quite sensible. > As a separate matter, several variables are not exportable. These > are: $apid, $apids, $cdpath, $home, $ifs, $path, $pid, and $*. > (Remember that $cdpath, $home, and $path are all aliased to upper case > versions, which *are* exportable. Also, the default assignment to > $path happens before $PATH is examined: so if $PATH is set, $path will > acquire its value instead of the default.) > > I think $bqstatus and $status ought to be non-exportable too. I've > just made them so; you can all see what this breaks in the next > release candidate :-). Seems good to me. Three questions: - Is $version exportable? - Is $version exported if the user doesn't assign to it? - Is $version inherited from the environment? --p From rc-owner Wed Apr 3 15:00:59 2002 Received: from artemis.le.ac.uk ([143.210.16.126]) by hawkwind.utcs.toronto.edu with SMTP id <9635>; Wed, 3 Apr 2002 15:00:51 -0500 Received: from happy.star.le.ac.uk ([143.210.36.58]) by artemis.le.ac.uk with smtp (Exim 3.16 #1) id 16slnE-00053u-00 for rc@hawkwind.utcs.toronto.edu; Wed, 03 Apr 2002 15:31:20 +0100 Received: (qmail 17969 invoked from network); 3 Apr 2002 14:31:30 -0000 Received: from fozzie.star.le.ac.uk (143.210.36.216) by happy.star.le.ac.uk with QMQP; 3 Apr 2002 14:31:30 -0000 Date: Wed, 3 Apr 2002 09:31:30 -0500 Message-ID: <20020403143130.22327.qmail@happy.star.le.ac.uk> From: Tim Goodwin To: paul@paulhaahr.com CC: rc@hawkwind.utcs.toronto.edu In-reply-to: <8ZFwtjf51i@dmul.paulhaahr.com> Subject: Re: rc 1.6 $version References: <20020314223715.003CB3F40B@quanstro.net> <20020327132716.23114.qmail@happy.star.le.ac.uk> <20020327221226.A25153@strozzi.it> <8ZFwtjf51i@dmul.paulhaahr.com> Paul Haahr wrote: > > Any objections to `rc_version'? > > I'd prefer $rc-version, but either should be fine. (As it turns out, this is all irrelevant, but I have would two objections to this. First, `-' turns on free careting, so you'd have to say things like this. ; whatis $'rc-version' Not so bad, but wrap it in another level of quotes, perhaps from a less sane shell, and it starts to get *very* ugly. $ rc -c 'whatis $'"'rc-version'" Secondly, rc is meant to be C-ish, not Lisp-ish.) > However, making it such a magic variable feels silly. As Eric noted, > having assignments to a variable just be eaten without warning seems, > er, surprising at best. Mea culpa. I failed to realise that there are two types of special variable in rc: 1) those that merely have a default initial value, and 2) those that invoke special code when substituted. Till now, $version was in category 2. I've just moved it to category 1. Category 2 now contains just $apids and $status, which seems about right; they are both, of necessity, magical. Category 1 now contains $ifs, $path, $pid, $prompt, and $version. (I was surprised to discover that assignments to pid are persistent!) As a separate matter, several variables are not exportable. These are: $apid, $apids, $cdpath, $home, $ifs, $path, $pid, and $*. (Remember that $cdpath, $home, and $path are all aliased to upper case versions, which *are* exportable. Also, the default assignment to $path happens before $PATH is examined: so if $PATH is set, $path will acquire its value instead of the default.) I think $bqstatus and $status ought to be non-exportable too. I've just made them so; you can all see what this breaks in the next release candidate :-). Tim. From rc-owner Thu Apr 4 15:46:29 2002 Received: from apollo.le.ac.uk ([143.210.16.125]) by hawkwind.utcs.toronto.edu with SMTP id <75921>; Thu, 4 Apr 2002 15:45:03 -0500 Received: from happy.star.le.ac.uk ([143.210.36.58]) by apollo.le.ac.uk with smtp (Exim 3.16 #1) id 16t46X-0005rt-00 for rc@hawkwind.utcs.toronto.edu; Thu, 04 Apr 2002 11:04:29 +0100 Received: (qmail 20283 invoked from network); 4 Apr 2002 10:04:45 -0000 Received: from fozzie.star.le.ac.uk (143.210.36.216) by happy.star.le.ac.uk with QMQP; 4 Apr 2002 10:04:45 -0000 Date: Thu, 4 Apr 2002 05:04:45 -0500 Message-ID: <20020404100445.8968.qmail@happy.star.le.ac.uk> From: Tim Goodwin To: paul@paulhaahr.com CC: rc@hawkwind.utcs.toronto.edu In-reply-to: <8ZFwtjf51i@dmul.paulhaahr.com> Subject: Re: rc 1.6 $version References: <20020314223715.003CB3F40B@quanstro.net> <20020327132716.23114.qmail@happy.star.le.ac.uk> <20020327221226.A25153@strozzi.it> <8ZFwtjf51i@dmul.paulhaahr.com> > Why not just initialize version (provided there's none set in the > environment?), not export it, and have any assignments turn it into a > normal variable. I think that's pretty easy to do. OK, after a couple of iterations I've now done exactly that. I've made $prompt act in the same way; I wonder if $ifs should too? The other variables to which rc gives default values: $path and $pid; are never exported. All this will be in another release candidate soon... Tim. From rc-owner Thu Apr 4 15:46:30 2002 Received: from apollo.le.ac.uk ([143.210.16.125]) by hawkwind.utcs.toronto.edu with SMTP id <9715>; Thu, 4 Apr 2002 15:46:22 -0500 Received: from happy.star.le.ac.uk ([143.210.36.58]) by apollo.le.ac.uk with smtp (Exim 3.16 #1) id 16t9Pt-0003YP-00 for rc@hawkwind.utcs.utoronto.ca; Thu, 04 Apr 2002 16:44:49 +0100 Received: (qmail 14283 invoked from network); 4 Apr 2002 15:45:10 -0000 Received: from fozzie.star.le.ac.uk (143.210.36.216) by happy.star.le.ac.uk with QMQP; 4 Apr 2002 15:45:10 -0000 Date: Thu, 4 Apr 2002 10:45:10 -0500 Message-ID: <20020404154510.10281.qmail@happy.star.le.ac.uk> From: Tim Goodwin To: rc@hawkwind.utcs.utoronto.ca Subject: Last call for bugs I want to get rc-1.7 wrapped up in the next couple of weeks. There will be another release candidate (watch this space), but my hope is that it will be the last before the full release. So... if anybody has any outstanding issues with rc-1.6c6, please let me know as soon as possible. Thanks, Tim. From rc-owner Thu Apr 4 16:48:28 2002 Received: from galapagos.cse.psu.edu ([130.203.12.17]) by hawkwind.utcs.toronto.edu with SMTP id <9733>; Thu, 4 Apr 2002 16:48:09 -0500 Received: (qmail 17434 invoked by uid 991); 4 Apr 2002 21:42:34 -0000 Message-ID: <20020404214234.17433.qmail@g.bio.cse.psu.edu> Date: Thu, 4 Apr 2002 16:42:34 -0500 To: Tim Goodwin cc: rc@hawkwind.utcs.toronto.edu Subject: Re: rc 1.6 $version In-Reply-To: Message from Tim Goodwin of "Thu, 04 Apr 2002 05:04:45 EST." <20020404100445.8968.qmail@happy.star.le.ac.uk> Date: Thu, 4 Apr 2002 16:42:34 -0500 From: Scott Schwartz | > Why not just initialize version (provided there's none set in the | > environment?), not export it, and have any assignments turn it into a | > normal variable. I think that's pretty easy to do. | | OK, after a couple of iterations I've now done exactly that. I dunno. In that case calling it rc_version makes more sense to me. Less likely to have accidental collisions. From rc-owner Thu Apr 4 16:57:10 2002 Received: from harrier.prod.itd.earthlink.net ([207.217.120.12]) by hawkwind.utcs.toronto.edu with SMTP id <9734>; Thu, 4 Apr 2002 16:57:04 -0500 Received: from user-vcaun2o.dsl.mindspring.com ([216.175.92.88] helo=rakitzis.com) by harrier.prod.itd.earthlink.net with esmtp (Exim 3.33 #1) id 16tFBU-0006oB-00; Thu, 04 Apr 2002 13:54:20 -0800 Received: (from byron@localhost) by rakitzis.com (8.11.0/8.11.0) id g34LsCA02397; Thu, 4 Apr 2002 13:54:12 -0800 Date: Thu, 4 Apr 2002 16:54:12 -0500 From: Byron Rakitzis Message-Id: <200204042154.g34LsCA02397@rakitzis.com> To: paul@paulhaahr.com, tjg@star.le.ac.uk Subject: Re: rc 1.6 $version Cc: rc@hawkwind.utcs.toronto.edu >I've made $prompt act in the same way; I wonder if $ifs should too? I would have thought you'd want to export $prompt. What about subshells? From rc-owner Fri Apr 5 00:30:00 2002 Received: from shell.vex.net ([216.126.72.2]) by hawkwind.utcs.toronto.edu with SMTP id <9739>; Fri, 5 Apr 2002 00:29:37 -0500 Received: by shell.vex.net (Postfix, from userid 1005) id 9EBDB5B701; Thu, 4 Apr 2002 20:38:08 -0500 (EST) To: byron@rakitzis.com, paul@paulhaahr.com, tjg@star.le.ac.uk Subject: Re: rc 1.6 $version Cc: rc@hawkwind.utcs.toronto.edu Message-Id: <20020405013808.9EBDB5B701@shell.vex.net> Date: Thu, 4 Apr 2002 20:38:08 -0500 From: smarry@vex.net (Smarasderagd) >I would have thought you'd want to export $prompt. I'd rather have prompt exported as well. From rc-owner Fri Apr 5 04:33:47 2002 Received: from apollo.le.ac.uk ([143.210.16.125]) by hawkwind.utcs.toronto.edu with SMTP id <9748>; Fri, 5 Apr 2002 04:33:27 -0500 Received: from happy.star.le.ac.uk ([143.210.36.58]) by apollo.le.ac.uk with smtp (Exim 3.16 #1) id 16tPBr-0006Uc-00 for rc@hawkwind.utcs.toronto.edu; Fri, 05 Apr 2002 09:35:23 +0100 Received: (qmail 26830 invoked from network); 5 Apr 2002 08:35:44 -0000 Received: from fozzie.star.le.ac.uk (143.210.36.216) by happy.star.le.ac.uk with QMQP; 5 Apr 2002 08:35:44 -0000 Date: Fri, 5 Apr 2002 03:35:44 -0500 Message-ID: <20020405083544.19565.qmail@happy.star.le.ac.uk> From: Tim Goodwin To: rc@hawkwind.utcs.toronto.edu In-reply-to: <200204042154.g34LsCA02397@rakitzis.com> (byron@rakitzis.com) Subject: Re: rc 1.6 $version References: <200204042154.g34LsCA02397@rakitzis.com> > I would have thought you'd want to export $prompt. It's exported if it's changed from the default. The motivation for doing so was this little snippet: $ env - rc ; printenv PATH=/usr/local/bin:/usr/bin:/bin:. prompt=; ^A No point in cluttering the environment with a value that any descendant rc process would default to anyway. And since I'd just invented the mechanism to export $version only if it's assigned to (all 3 lines of code of it!), I thought I'd use it. So in the dev version, we get this. $ env - rc ; printenv PATH=/usr/local/bin:/usr/bin:/bin:. ; prompt=('rc$ ' '') rc$ printenv PATH=/usr/local/bin:/usr/bin:/bin:. prompt=rc$ ^A (And even PATH goes away if you build with `--disable-def-path'.) Tim. From rc-owner Thu May 23 13:53:21 2002 Received: from artemis.le.ac.uk ([143.210.16.126]) by hawkwind.utcs.utoronto.ca with SMTP id <48361>; Thu, 23 May 2002 13:52:17 -0500 Received: from happy.star.le.ac.uk ([143.210.36.58]) by artemis.le.ac.uk with smtp (Exim 3.16 #1) id 17AXMA-00047M-00 for rc@hawkwind.utcs.utoronto.ca; Wed, 22 May 2002 15:44:50 +0100 Received: (qmail 21920 invoked from network); 22 May 2002 14:45:10 -0000 Received: from fozzie.star.le.ac.uk (143.210.36.216) by happy.star.le.ac.uk with QMQP; 22 May 2002 14:45:10 -0000 Date: Wed, 22 May 2002 10:45:10 -0500 Message-ID: <20020522144510.1530.qmail@happy.star.le.ac.uk> From: Tim Goodwin To: rc@hawkwind.utcs.utoronto.ca Subject: Release candidate rc-1.6c7 available A new beta release, which is also a release candidate for the next full release, is available from the usual place. http://www.star.le.ac.uk/~tjg/rc/beta/rc-1.6c7.tar.gz I've appended the ChangeLog since the last release candidate. You know the drill: please build and test this on as many systems as you have access to. Let me know if it works, and especially if it doesn't. Thanks, Tim. 2002-04-03 Feature: make $version less magical, and exportable if it's changed from its default value. Same for $prompt (thank Erik Quanstrom). Bug: make $bqstatus and $status not exportable. Feature: "stuttering" colons for multiple replacements in the history programs (thanks Callum Gibson). 2002-05-22 Documentation: possible warning in tripping.c (thanks Dan Moniz). Release: rc-1.6c7. From rc-owner Tue Jun 11 15:38:09 2002 Received: from hotel.rmta.org ([204.60.204.106]) by hawkwind.utcs.utoronto.ca with SMTP id <49353>; Tue, 11 Jun 2002 15:37:47 -0500 Received: (qmail 87173 invoked by uid 1001); 10 Jun 2002 03:46:44 -0000 Date: Sun, 9 Jun 2002 23:46:43 -0500 From: Scott Kenney To: Tim Goodwin Cc: rc@hawkwind.utcs.toronto.edu Subject: Re: Release candidate rc-1.6c7 available Message-ID: <20020609234643.A87166@hotel.rmta.org> Mail-Followup-To: Scott Kenney , Tim Goodwin , rc@hawkwind.utcs.toronto.edu References: <20020522144510.1530.qmail@happy.star.le.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20020522144510.1530.qmail@happy.star.le.ac.uk>; from tjg@star.le.ac.uk on Wed, May 22, 2002 at 10:45:10AM -0500 On Wed, May 22, 2002 at 10:45:10AM -0500, Tim Goodwin wrote: > A new beta release, which is also a release candidate for the next > full release, is available from the usual place. > > http://www.star.le.ac.uk/~tjg/rc/beta/rc-1.6c7.tar.gz > > I've appended the ChangeLog since the last release candidate. > > You know the drill: please build and test this on as many systems as > you have access to. Let me know if it works, and especially if it > doesn't. Builds and trips fine on: FreeBSD hotel.rmta.org 4.6-RC FreeBSD 4.6-RC #2: Thu Jun 6 03:53:29 EDT 2002 i386 gcc version 2.95.3 20010315 release [FreeBSD] SunOS china.rmta.org 5.5 Generic_103093-28 sun4m sparc SUNW,SPARCclassic gcc version 3.1 NetBSD spark.rmta.org 1.6A NetBSD 1.6A (SPARK) #5: Tue Jun 4 10:05:33 EDT 2002 sparc gcc version 2.95.3 20010315 (release) (NetBSD nb2) -- Scott Kenney >|< saken@hotel.rmta.org From rc-owner Thu Jun 20 14:37:07 2002 Received: from apollo.le.ac.uk ([143.210.16.125]) by hawkwind.utcs.utoronto.ca with SMTP id <50097>; Thu, 20 Jun 2002 14:36:40 -0500 Received: from happy.star.le.ac.uk ([143.210.36.58]) by apollo.le.ac.uk with smtp (Exim 3.16 #1) id 17L3pk-0004CF-00 for rc@hawkwind.utcs.utoronto.ca; Thu, 20 Jun 2002 16:26:52 +0100 Received: (qmail 10805 invoked from network); 20 Jun 2002 15:27:14 -0000 Received: from fozzie.star.le.ac.uk (143.210.36.216) by happy.star.le.ac.uk with QMQP; 20 Jun 2002 15:27:14 -0000 Date: Thu, 20 Jun 2002 11:27:14 -0500 Message-ID: <20020620152714.15826.qmail@happy.star.le.ac.uk> From: Tim Goodwin To: rc@hawkwind.utcs.utoronto.ca Subject: Release rc-1.7 is now available I'm delighted to announce the release of rc-1.7. Apart from bumping the version number, and a couple of trivial changes to the installation documentation, this release is identical to rc-1.6c7. The release is available from the usual place: http://www.star.le.ac.uk/~tjg/rc/release/rc-1.7.tar.gz and it should also be on the UToronto FTP server soon. I've appended the NEWS file from the distribution, as a reminder of what's changed since rc-1.6. (In summary: not a lot!) A big thank you to everybody who contributed to this release. Tim. Highlights of changes since rc-1.6. See ChangeLog for further details. Portability. Many minor tweaks, including fixes for BeOS, CygWin, QNX, and gcc-3. Bug fixes. A number of bugs have been fixed. The serious ones were: a core dump, triggered by `~ () '*''; premature exit, triggered by sourcing a file which could be open()ed but not read() (such as a directory on many systems); uninterruptible looping, triggered by semantic errors in `fn prompt'; deficiencies in the `limit' builtin. New features. The following features are new: the `$version' variable replaces the `-V' flag; the `-I' flag (definitively not interactive) was added for compatibility with the Plan 9 rc; ASCII SOH (^A) is now handled transparently; support for large files; support for more process resource limits. Documentation. Distributions of this rc used to include a PostScript paper given by Tom Duff to the UKUUG, describing the Plan 9 rc. This paper is no longer distributed with rc, but instead is available on the web, both in its original PostScript version, and an updated HTML version. Tim Goodwin 2002-05-21 From rc-owner Sun Jun 23 13:37:56 2002 Received: from imr1.aus.deuba.com ([203.0.62.7]) by hawkwind.utcs.utoronto.ca with SMTP id <50134>; Sun, 23 Jun 2002 13:37:43 -0500 Received: from imr1.aus.deuba.com by imr1.aus.deuba.com id g5L09U4M011040; Fri, 21 Jun 2002 10:09:30 +1000 (EST) Received: from merton.aus.deuba.com by imr1.aus.deuba.com id g5L09UIp011035; Fri, 21 Jun 2002 10:09:30 +1000 (EST) Received: (qmail 48467 invoked by uid 107); 21 Jun 2002 00:09:30 -0000 Message-ID: <20020621000930.48466.qmail@merton.aus.deuba.com> From: callum.gibson@db.com Subject: found a problem, sorry To: rc@hawkwind.utcs.utoronto.ca (rc Shell) Date: Thu, 20 Jun 2002 20:09:30 -0500 X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit I wish I'd seen this before the release but I haven't been testing them religiously. Both 1.6c6 and 1.7 hang in make trip in the current directory globbing on Solaris 2.6 - truss output shows: 6477/1: getdents64(3, 0x0005F208, 1048) (sleeping...) Something else is fishy because I can't even connect to the process using adb. /usr/proc/bin/pstack only reports half a stack... ; /usr/proc/bin/pstack 6477 6477: ./rc -p ef739ae0 getdents64 (3, 5f208, 418) ef74c0e8 _readdir64 (0, 0, 0, 0, 0, 0) + bc I have a vague recollection this might be something to do with dodgey large file support on Solaris 2.6 which needs a patch to fix? Apart from that it actually works fine in real life. Also trips fine on FreeBSD 4.5-RELEASE. Does anyone know if there are mailing list archives stored anywhere? There's no link from the rc home page but I think I've come across it before. C Callum Gibson callum.gibson@db.com Global Markets IT, Deutsche Bank, Australia 61 2 9258 1620 ### The opinions in this message are mine and not Deutsche's ### From rc-owner Thu Jun 27 15:56:49 2002 Received: from apollo.le.ac.uk ([143.210.16.125]) by hawkwind.utcs.utoronto.ca with SMTP id <52361>; Thu, 27 Jun 2002 15:55:43 -0500 Received: from happy.star.le.ac.uk ([143.210.36.58]) by apollo.le.ac.uk with smtp (Exim 3.16 #1) id 17MsIv-0000Fj-00 for rc@hawkwind.utcs.toronto.edu; Tue, 25 Jun 2002 16:32:29 +0100 Received: (qmail 13156 invoked from network); 25 Jun 2002 15:32:50 -0000 Received: from fozzie.star.le.ac.uk (143.210.36.216) by happy.star.le.ac.uk with QMQP; 25 Jun 2002 15:32:50 -0000 Date: Tue, 25 Jun 2002 11:32:50 -0500 Message-ID: <20020625153250.31276.qmail@happy.star.le.ac.uk> From: Tim Goodwin To: callum.gibson@db.com CC: rc@hawkwind.utcs.toronto.edu In-reply-to: <20020621000930.48466.qmail@merton.aus.deuba.com> (callum.gibson@db.com) Subject: Re: found a problem, sorry References: <20020621000930.48466.qmail@merton.aus.deuba.com> > I wish I'd seen this before the release but I haven't been testing them > religiously. Both 1.6c6 and 1.7 hang in make trip in the current directory > globbing on Solaris 2.6 - truss output shows: It's not as serious as you think; rc makes and trips fine on at least one Solaris 2.6 box that I have here. Suggest we take this off the list till we get to the bottom of it. Can you send me the output of `showrev -p' on your failing 2.6 box? Also, are you building on a local filesystem, or NFS, etc? > Does anyone know if there are mailing list archives stored anywhere? There's > no link from the rc home page but I think I've come across it before. There's a couple of list archive files in ftp://ftp.sys.utoronto.ca/pub/rc/ but it only seems to go up to January 2001. Tim. From rc-owner Wed Jul 31 15:26:30 2002 Received: from gw.goop.org ([206.170.148.147]) by hawkwind.utcs.toronto.edu with SMTP id <25429>; Wed, 31 Jul 2002 15:26:18 -0500 Received: by gw.goop.org (Postfix, from userid 525) id A825178430; Tue, 30 Jul 2002 23:15:47 -0700 (PDT) Received: from ixodes.goop.org (ixodes.goop.org [192.168.0.5]) by gw.goop.org (Postfix) with ESMTP id 726407842F for ; Tue, 30 Jul 2002 23:15:47 -0700 (PDT) Subject: minor nits picked up by valgrind From: Jeremy Fitzhardinge To: rc list Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.8 Date: Wed, 31 Jul 2002 02:15:47 -0500 Message-Id: <1028096147.2444.57.camel@ixodes.goop.org> Mime-Version: 1.0 Since valgrind[1] came out, I've been applying it to everything I can think of. rc was pretty clean, with one actual (but minor) problem and one non-problem. The actual problem is that it doesn't clear out the sa_mask when calling sigaction, which presumably means that there's a random set of signals masked when calling the signal handler. I'm assuming this isn't a big problem. Maybe it should be sigfillset instead? The non-problem is that it tries to call sigaction on SIGKILL and SIGSTOP. This is ignored by the kernel, but it makes valgrind complain. Here's a patch for both of these: --- rc-1.7/signal.c Thu Nov 1 03:29:10 2001 +++ rc-1.7.jsgf/signal.c Tue Jul 30 23:08:39 2002 @@ -14,6 +14,7 @@ new.sa_handler = handler; new.sa_flags = SA_INTERRUPT; + sigemptyset(&new.sa_mask); sigaction(signum, &new, &old); return old.sa_handler; } @@ -96,6 +97,8 @@ #endif for (i = 1; i < NUMOFSIGNALS; i++) { + if (i == SIGSTOP || i == SIGKILL) + continue; h = sys_signal(i, SIG_IGN); if (h != SIG_IGN && h != SIG_ERR) sys_signal(i, h); J 1: http://developer.kde.org/~sewardj/ From rc-owner Thu Aug 15 16:02:57 2002 Received: from artemis.le.ac.uk ([143.210.16.126]) by hawkwind.utcs.toronto.edu with SMTP id <26079>; Thu, 15 Aug 2002 16:02:12 -0500 Received: from mail.star.le.ac.uk ([143.210.36.58] helo=happy.star.le.ac.uk) by artemis.le.ac.uk with smtp (Exim 3.16 #1) id 17fMXJ-0001SC-00 for rc@hawkwind.utcs.toronto.edu; Thu, 15 Aug 2002 16:27:45 +0100 Received: (qmail 19308 invoked from network); 15 Aug 2002 15:28:05 -0000 Received: from rocinante.star.le.ac.uk (143.210.36.80) by mail.star.le.ac.uk with QMQP; 15 Aug 2002 15:28:05 -0000 Date: Thu, 15 Aug 2002 11:28:30 -0500 Message-ID: <20020815152830.14813.qmail@rocinante.star.le.ac.uk> From: Tim Goodwin To: jeremy@goop.org CC: rc@hawkwind.utcs.toronto.edu In-reply-to: <1028096147.2444.57.camel@ixodes.goop.org> (jeremy@goop.org) Subject: Re: minor nits picked up by valgrind References: <1028096147.2444.57.camel@ixodes.goop.org> > Since valgrind[1] came out, I've been applying it to everything I can > think of. rc was pretty clean, with one actual (but minor) problem and > one non-problem. OK, I'll buy both of these. Thanks! And looking again at the signal code, I found a major booboo (of my own making), which pulled in the horrid longjmp() code on systems where it was needed. With this, and some other problems I've fixed, there have been a few changes since rc-1.7. A summary is appended, and please see my hacking page for further details. http://www.star.le.ac.uk/~tjg/rc/misc/notes So, time for a new snapshot. Here it is: http://www.star.le.ac.uk/~tjg/rc/snap/rc-1.7s20020815.tar.gz Tim. 2002-07-25 Bug: fix globbing of broken symlinks. 2002-07-31 Bug: readline doesn't handle EIO either. 2002-08-15 Bug: variables that are sometimes exported (i.e. $prompt and $version) need to be made exportable if they are inherited from the environment. Portability: don't call sigaction() for SIGKILL or SIGSTOP; don't hand a garbage signal mask to sigaction() (thanks Jeremy Fitzhardinge). Also, remove use of SA_INTERRUPT (SUSv3, BSD, etc. have SA_RESTART with the inverted meaning). From rc-owner Fri Nov 29 18:21:31 2002 Received: from artemis.le.ac.uk ([143.210.16.126]) by hawkwind.utcs.toronto.edu with SMTP id <37999>; Fri, 29 Nov 2002 18:20:33 -0500 Received: from mail.star.le.ac.uk ([143.210.36.58]) by artemis.le.ac.uk with smtp (Exim 3.16 #1) id 18H4rI-0000nR-00 for rc@hawkwind.utcs.utoronto.ca; Wed, 27 Nov 2002 16:16:16 +0000 Received: (qmail 25318 invoked from network); 27 Nov 2002 16:16:37 -0000 Received: from rocinante.star.le.ac.uk (143.210.36.80) by mail.star.le.ac.uk with QMQP; 27 Nov 2002 16:16:37 -0000 Date: Wed, 27 Nov 2002 11:16:37 -0500 Message-ID: <20021127161637.21255.qmail@rocinante.star.le.ac.uk> From: Tim Goodwin To: rc@hawkwind.utcs.utoronto.ca Subject: New rc snapshot available A new snapshot is available from the usual place. http://www.star.le.ac.uk/~tjg/rc/snap/rc-1.7s20021127.tar.gz ChangeLog entries since the release of rc-1.7 are appended. Since there are a number of useful bug fixes since the last release, I am keen to wrap up a new release (probably to be called rc-1.7.1) as soon as possible. Please, therefore, take a few minutes to test out this new snapshot and let me know how it works for you. Thanks, Tim. 2002-07-25 Bug: fix globbing of broken symlinks. 2002-07-31 Bug: readline doesn't handle EIO either. 2002-08-15 Bug: variables that are sometimes exported (i.e. $prompt and $version) need to be made exportable if they are inherited from the environment. Portability: don't call sigaction() for SIGKILL or SIGSTOP; don't hand a garbage signal mask to sigaction() (thanks Jeremy Fitzhardinge). Also, remove use of SA_INTERRUPT (SUSv3, BSD, etc. have SA_RESTART with the inverted meaning). 2002-08-20 Bug: don't call ealloc(0) on systems where getgroups() doesn't return egid (thanks Chris Siebenmann). 2002-11-27 Bug: history dumps core if more colons than substitutions (thanks Callum Gibson); history fails to avoid itself if it's the only command; history writes and reads outside allocated memory. Configuration: upgrade to autoconf-2.56 and automake-1.7.1. From rc-owner Mon Sep 1 17:09:38 2003 Received: from plan9.cs.bell-labs.com ([204.178.31.2]) by hawkwind.utcs.utoronto.ca with SMTP id <43426>; Mon, 1 Sep 2003 17:06:07 -0500 Received: from plan9.cs.bell-labs.com ([135.104.9.2]) by plan9; Thu Mar 27 21:38:32 EST 2003 Received: from 64.36.89.66 ([64.36.89.66]) by plan9; Thu Mar 27 21:38:29 EST 2003 Message-ID: To: rc@hawkwind.utcs.toronto.edu Subject: patch for double redirection From: "Russ Cox" Date: Thu, 27 Mar 2003 21:38:34 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit For anyone who's interested, this patch adds a <> operator that redirects both from and to a file. It's not really useful unless the file is a named pipe. I don't think it's worth putting into the standard source, but it might be worth keeping if there is a stock of marginal patches somewhere. Russ diff -c rc-1.7/footobar.c rc-1.7-rsc/footobar.c *** rc-1.7/footobar.c 2001-10-12 05:10:27.000000000 -0400 --- rc-1.7-rsc/footobar.c 2003-03-27 21:28:54.000000000 -0500 *************** *** 30,35 **** --- 30,36 ---- case rCreate: name = ">"; break; case rAppend: name = ">>"; break; case rFrom: name = "<"; break; + case rFromTo: name = "<>"; break; case rHeredoc: name = "<<"; break; case rHerestring: name = "<<<"; break; } diff -c rc-1.7/lex.c rc-1.7-rsc/lex.c *** rc-1.7/lex.c 2001-10-12 06:21:05.000000000 -0400 --- rc-1.7-rsc/lex.c 2003-03-27 21:23:59.000000000 -0500 *************** *** 286,291 **** --- 286,294 ---- } else { y->redir.type = rHeredoc; } + } else if (c == '>') { + c = gchar(); + y->redir.type = rFromTo; } else y->redir.type = rFrom; y->redir.fd = 0; *************** *** 299,305 **** y->redir.fd = fd_left; return SREDIR; } ! return (y->redir.type == rFrom || y->redir.type == rCreate) ? REDIR : SREDIR; } else { /* dup; recast yylval */ y->dup.type = y->redir.type; y->dup.left = fd_left; --- 302,315 ---- y->redir.fd = fd_left; return SREDIR; } ! switch (y->redir.type) { ! case rFrom: ! case rCreate: ! case rFromTo: ! return REDIR; ! default: ! return SREDIR; ! } } else { /* dup; recast yylval */ y->dup.type = y->redir.type; y->dup.left = fd_left; diff -c rc-1.7/open.c rc-1.7-rsc/open.c *** rc-1.7/open.c 2000-05-25 10:29:53.000000000 -0400 --- rc-1.7-rsc/open.c 2003-03-27 21:06:49.000000000 -0500 *************** *** 15,21 **** static const int mode_masks[] = { /* rFrom */ O_RDONLY, /* rCreate */ O_TRUNC | O_CREAT | O_WRONLY, ! /* rAppend */ O_APPEND | O_CREAT | O_WRONLY }; extern int rc_open(const char *name, redirtype m) { --- 15,22 ---- static const int mode_masks[] = { /* rFrom */ O_RDONLY, /* rCreate */ O_TRUNC | O_CREAT | O_WRONLY, ! /* rAppend */ O_APPEND | O_CREAT | O_WRONLY, ! /* rFromTo */ O_RDWR, }; extern int rc_open(const char *name, redirtype m) { diff -c rc-1.7/rc.h rc-1.7-rsc/rc.h *** rc-1.7/rc.h 2002-05-22 09:18:24.000000000 -0400 --- rc-1.7-rsc/rc.h 2003-03-27 21:07:05.000000000 -0500 *************** *** 51,57 **** } inputtype; typedef enum redirtype { ! rFrom, rCreate, rAppend, rHeredoc, rHerestring } redirtype; typedef bool (*Conv)(Format *, int); --- 51,57 ---- } inputtype; typedef enum redirtype { ! rFrom, rCreate, rAppend, rFromTo, rHeredoc, rHerestring } redirtype; typedef bool (*Conv)(Format *, int); diff -c rc-1.7/redir.c rc-1.7-rsc/redir.c *** rc-1.7/redir.c 1992-05-17 00:51:43.000000000 -0400 --- rc-1.7-rsc/redir.c 2003-03-27 21:26:20.000000000 -0500 *************** *** 50,56 **** default: panic("unexpected node in doredirs"); /* NOTREACHED */ ! case rCreate: case rAppend: case rFrom: fd = rc_open(fname->w, r->r->u[0].i); break; } --- 50,56 ---- default: panic("unexpected node in doredirs"); /* NOTREACHED */ ! case rCreate: case rAppend: case rFrom: case rFromTo: fd = rc_open(fname->w, r->r->u[0].i); break; } From rc-owner Mon Sep 1 17:09:54 2003 Received: from mailout.TechFak.Uni-Bielefeld.DE ([129.70.136.245]) by hawkwind.utcs.utoronto.ca with SMTP id <15719>; Mon, 1 Sep 2003 17:05:14 -0500 Received: from grimsvotn.TechFak.Uni-Bielefeld.DE (grimsvotn.TechFak.Uni-Bielefeld.DE [129.70.137.40]) by momotombo.TechFak.Uni-Bielefeld.DE (8.11.7+Sun/8.11.6/TechFak/2003/04/16/pk) with ESMTP id h7QHwuG15852 for ; Tue, 26 Aug 2003 19:58:56 +0200 (MEST) Received: from localhost (pk@localhost) by grimsvotn.TechFak.Uni-Bielefeld.DE (8.11.7+Sun/8.9.1) with SMTP id h7QHwu413254 for ; Tue, 26 Aug 2003 19:58:56 +0200 (MEST) Message-Id: <200308261758.h7QHwu413254@grimsvotn.TechFak.Uni-Bielefeld.DE> X-Authentication-Warning: grimsvotn.TechFak.Uni-Bielefeld.DE: pk owned process doing -bs X-Authentication-Warning: grimsvotn.TechFak.Uni-Bielefeld.DE: pk@localhost didn't use HELO protocol To: rc@hawkwind.utcs.toronto.edu Subject: Re: non login "rc" needs customized environment In-reply-to: Your message of "Wed, 27 Feb 2002 17:24:56 EST." <20020227222456.1110e2b2.matt@proweb.co.uk> X-Organization: Uni Bielefeld, Technische Fakultaet X-Phone: +49 521 106 2902 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <13249.1061920733.1@grimsvotn.TechFak.Uni-Bielefeld.DE> Date: Tue, 26 Aug 2003 13:58:56 -0500 From: Peter Koch > by all means offer extra startup stuff as some sort of option but rapid start >up time is one of the reasons (among many) I use rc sorry for reopening a thread I started 18 month ago and then failed to follow. It was about rc's not sourcing $HOME/.rcrc unless it's a login shell, which is not the case if it's ``started'' via rsh or ssh. Since the problem hit us again, I've built a patch that implements SHLVL similar to what tcsh, bash and others do. If SHLVL is present and set to a value >=1, it's incremented upon start, else it's set to 1. Then, if SHLVL==1 and the -c flag is present, $HOME/.rcrc is executed as if it were a login shell. This avoids the parsing overhead for every other invocation and for random '-c' invocations (thanks to Dave Mason for bringing up -c). A patch against rc-1.7s20021127 is available at http://www.TechFak.Uni-Bielefeld.DE/~pk/rc-1.7s20021127-patch.shlvl Usual disclaimer applies; the patch isn't nice, i.e. Makefile, configure and rc.1 are not yet updated. Comments and suggestions welcome. -Peter From rc-owner Mon Sep 1 18:25:16 2003 Received: from galapagos.cse.psu.edu ([130.203.12.17]) by hawkwind.utcs.utoronto.ca with SMTP id <16020>; Mon, 1 Sep 2003 18:25:12 -0500 Received: (qmail 17989 invoked by uid 991); 1 Sep 2003 21:17:52 -0000 Message-ID: <20030901211752.17988.qmail@g.bio.cse.psu.edu> Date: Mon, 1 Sep 2003 17:17:52 -0500 To: Peter Koch cc: rc@hawkwind.utcs.toronto.edu Subject: Re: non login "rc" needs customized environment In-reply-to: <200308261758.h7QHwu413254@grimsvotn.TechFak.Uni-Bielefeld.DE> References: <200308261758.h7QHwu413254@grimsvotn.TechFak.Uni-Bielefeld.DE> Comments: In-reply-to Peter Koch message dated "Tue, 26 Aug 2003 13:58:56 -0500." Date: Mon, 1 Sep 2003 17:17:51 -0500 From: Scott Schwartz | Since the problem hit us again, I've built a patch that implements SHLVL | similar to what tcsh, bash and others do. If SHLVL is present and set to | a value >=1, it's incremented upon start, else it's set to 1. Doesn't this interact with other shells? Maybe it should be RC_SHLVL? From rc-owner Mon Sep 1 18:50:18 2003 Received: from smtp.datapower.com ([67.93.141.188]) by hawkwind.utcs.utoronto.ca with SMTP id <16025>; Mon, 1 Sep 2003 18:50:11 -0500 Received: (qmail 28990 invoked by uid 529); 1 Sep 2003 22:18:13 -0000 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 1 Sep 2003 22:18:13 -0000 Date: Mon, 1 Sep 2003 18:18:13 -0500 From: Rich Salz To: Peter Koch cc: "rc@hawkwind.utcs.toronto.edu" Subject: Re: non login "rc" needs customized environment In-Reply-To: <200308261758.h7QHwu413254@grimsvotn.TechFak.Uni-Bielefeld.DE> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII > Since the problem hit us again, I've built a patch that implements SHLVL > similar to what tcsh, bash and others do. If SHLVL is present and set to > a value >=1, it's incremented upon start, else it's set to 1. > Then, if SHLVL==1 and the -c flag is present, $HOME/.rcrc is executed as > if it were a login shell. This avoids the parsing overhead for every other > invocation and for random '-c' invocations (thanks to Dave Mason for > bringing up -c). That's a pretty complicated set of semantics to implement in code. I'm not even sure I fully understand it. If, instead, rc exported its startup flags to something like "rcflags" as a special variable, then you could do everything you wanted in the script file without embedding magic in the code. For example if ( ~$#SHLVL 1 ) { SHLVL=1} else { SHLVL=`{expr $SHLVL + 1} } ~ $SHLVL 1 && ~ -c $cflags && . $HOME/.realrc /r$ -- Rich Salz Chief Security Architect DataPower Technology http://www.datapower.com XS40 XML Security Gateway http://www.datapower.com/products/xs40.html XML Security Overview http://www.datapower.com/xmldev/xmlsecurity.html From rc-owner Mon Sep 1 19:37:38 2003 Received: from bmr1-e1.aus.deuba.com ([203.0.62.7]) by hawkwind.utcs.utoronto.ca with SMTP id <16038>; Mon, 1 Sep 2003 19:37:29 -0500 Received: from bmr1-e1.aus.deuba.com by bmr1-e1.aus.deuba.com id h81MwlT8016532; Tue, 2 Sep 2003 08:58:48 +1000 (EST) Received: from merton.aus.deuba.com by bmr1-e1.aus.deuba.com id h81MwlAo016529; Tue, 2 Sep 2003 08:58:47 +1000 (EST) Received: (qmail 38830 invoked by uid 107); 1 Sep 2003 22:58:47 -0000 Date: Mon, 1 Sep 2003 18:58:47 -0500 From: Callum Gibson To: rc shell mailing list Subject: Re: non login "rc" needs customized environment Message-ID: <20030901225847.GC38275@merton.aus.deuba.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i On Mon, Sep 01, 2003 at 09:10:51PM +0000, Peter Koch wrote: }It was about rc's not sourcing $HOME/.rcrc unless it's a login shell, which }is not the case if it's ``started'' via rsh or ssh. I still think the default is backwards. .rcrc should always be read and then you could avoid reading it with a simple line or two: ~ $RCLVL () && RCLVL=1 || RCLVL=`{expr $RCLVL + 1} if (~ $RCLVL 1) { # do normal initialisation } That seems minimal overhead for having the functionality the "correct" way around. Then add a -f flag for fast start (not reading .rcrc) for those for whom even the lines above are too much overhead. -- Callum Gibson callum@db.com Global Markets IT, Deutsche Bank, Australia 61 2 9258 1620 ### The opinions in this message are mine and not Deutsche's ### From rc-owner Mon Sep 1 19:46:26 2003 Received: from localhost by hawkwind.utcs.utoronto.ca with SMTP id <16041>; Mon, 1 Sep 2003 19:46:22 -0500 To: rc shell mailing list Subject: Re: non login "rc" needs customized environment In-reply-to: callum.gibson's message of Mon, 01 Sep 2003 18:58:47 -0500. <20030901225847.GC38275@merton.aus.deuba.com> Date: Mon, 1 Sep 2003 19:46:06 -0500 From: Chris Siebenmann Message-Id: <03Sep1.194622edt.16041@hawkwind.utcs.utoronto.ca> | I still think the default is backwards. .rcrc should always be read | and then you could avoid reading it with a simple line or two: I strongly disagree. rc has an excellent, elegant, and fast method for initializing subshells from the environment, which has minimal overhead. Reading a file on all shell startups is slower and in some cases quite problematic. Rc works fine. The problem is rsh. Thus I feel that one should not slow down, contort, and break rc but instead fix rsh. - cks From rc-owner Mon Sep 1 20:03:21 2003 Received: from bmr1-e1.aus.deuba.com ([203.0.62.7]) by hawkwind.utcs.utoronto.ca with SMTP id <16047>; Mon, 1 Sep 2003 20:03:09 -0500 Received: from bmr1-e1.aus.deuba.com by bmr1-e1.aus.deuba.com id h8201pT8024328; Tue, 2 Sep 2003 10:01:52 +1000 (EST) Received: from merton.aus.deuba.com by bmr1-e1.aus.deuba.com id h8201pAo024325; Tue, 2 Sep 2003 10:01:51 +1000 (EST) Received: (qmail 39149 invoked by uid 107); 2 Sep 2003 00:01:51 -0000 Date: Mon, 1 Sep 2003 20:01:51 -0500 From: Callum Gibson To: rc shell mailing list Subject: Re: non login "rc" needs customized environment Message-ID: <20030902000151.GE38275@merton.aus.deuba.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i On Mon, Sep 01, 2003 at 11:46:39PM +0000, Chris Siebenmann wrote: }| I still think the default is backwards. .rcrc should always be read }| and then you could avoid reading it with a simple line or two: } } I strongly disagree. rc has an excellent, elegant, and fast method for }initializing subshells from the environment, which has minimal overhead. >From itself, yes. Not from any other place. You need a login shell or an extra flag. }Reading a file on all shell startups is slower and in some cases quite }problematic. } } Rc works fine. The problem is rsh. Thus I feel that one should not }slow down, contort, and break rc but instead fix rsh. I realise it's a religious issue, particularly as far as rc goes, but it's harder to fix rsh, ssh, rexec, $SHELL in an editor or any of the number of other ways of invocating a user's shell, and changing them so they invoke the shell as a login shell (or with -l) without breaking a lot more things. How about an alternate idea which hasn't been mentioned yet? An invocation of rc as 'lrc' will cause rc to run as a login shell (and hence read the .rcrc). That would keep everyone happy - the only change people need to make for getting things initialised from ssh and rsh is to change their login shell to lrc. -- Callum Gibson callum@db.com Global Markets IT, Deutsche Bank, Australia 61 2 9258 1620 ### The opinions in this message are mine and not Deutsche's ### From rc-owner Mon Sep 1 20:09:48 2003 Received: from localhost by hawkwind.utcs.utoronto.ca with SMTP id <16050>; Mon, 1 Sep 2003 20:09:38 -0500 To: rc shell mailing list Subject: Re: non login "rc" needs customized environment In-reply-to: callum.gibson's message of Mon, 01 Sep 2003 20:01:51 -0500. <20030902000151.GE38275@merton.aus.deuba.com> Date: Mon, 1 Sep 2003 20:09:31 -0500 From: Chris Siebenmann Message-Id: <03Sep1.200938edt.16050@hawkwind.utcs.utoronto.ca> | I realise it's a religious issue, particularly as far as rc goes, but it's | harder to fix rsh, ssh, rexec, $SHELL in an editor or any of the | number of other ways of invocating a user's shell, [...] Anything involved from inside a login session already works fine (eg, $SHELL in an editor), precisely because rc inherits the environment and exports functions into it. You can even do per-shell initialization this way via the 'prompt' function. It's only things that want to start a full shell environment from scratch without going through a login session that are in trouble. And even then there are usually ways around the problem, for example explicitly sourcing a setup file when you run something via rsh/ssh. - cks From rc-owner Mon Sep 1 20:25:29 2003 Received: from galapagos.cse.psu.edu ([130.203.12.17]) by hawkwind.utcs.utoronto.ca with SMTP id <16057>; Mon, 1 Sep 2003 20:25:21 -0500 Received: (qmail 19165 invoked by uid 991); 2 Sep 2003 00:21:19 -0000 Message-ID: <20030902002119.19164.qmail@g.bio.cse.psu.edu> Date: Mon, 1 Sep 2003 20:21:19 -0500 To: Chris Siebenmann cc: rc shell mailing list Subject: Re: non login "rc" needs customized environment In-reply-to: <03Sep1.194622edt.16041@hawkwind.utcs.utoronto.ca> References: <03Sep1.194622edt.16041@hawkwind.utcs.utoronto.ca> Comments: In-reply-to Chris Siebenmann message dated "Mon, 01 Sep 2003 19:46:06 -0500." Date: Mon, 1 Sep 2003 20:21:19 -0500 From: Scott Schwartz Hear hear! From rc-owner Thu Sep 4 13:29:32 2003 Received: from artemis.le.ac.uk ([143.210.16.126]) by hawkwind.utcs.utoronto.ca with SMTP id <16128>; Thu, 4 Sep 2003 13:25:20 -0500 Received: from [143.210.36.58] (helo=mail.star.le.ac.uk) by artemis.le.ac.uk with smtp (Exim 4.21) id 19uCc3-00039c-TK for rc@hawkwind.utcs.utoronto.ca; Tue, 02 Sep 2003 15:58:31 +0100 Received: (qmail 10436 invoked from network); 2 Sep 2003 14:58:51 -0000 Received: from rocinante.star.le.ac.uk (143.210.36.80) by mail.star.le.ac.uk with QMQP; 2 Sep 2003 14:58:51 -0000 Date: Tue, 2 Sep 2003 10:58:53 -0500 Message-ID: <20030902145853.29478.qmail@mail.star.le.ac.uk> From: Tim Goodwin To: rc@hawkwind.utcs.utoronto.ca Subject: Release: rc-1.7.1 A couple of minor bugfixes have been languishing in the rc development source for a while: so I think it's time for a new release. The NEWS file is appended. (Yes, I wrapped this release up a few weeks ago, but didn't get round to telling anyone. Sorry 'bout that.) As the tripartite version number is intended to indicate, there's nothing new here relative to rc-1.7. http://www.star.le.ac.uk/~tjg/rc/release/rc-1.7.1.tar.gz Tim. Highlights of changes since rc-1.7. See ChangeLog for further details. Portability. A fix to the autoconfiguration means that the nasty longjmp() code is now omitted for all modern Unix systems; previously rc only did the Right Thing on Linux. The test for large files in trip.rc was removed, as this causes indigestion on file systems that don't support sparse files (the configuration and implementation of large file support is still present of course). Bug fixes. Broken symlinks now glob correctly. The variables $prompt and $version are now exported if they are inherited from the environment when rc starts. EIO handling is now enabled for readline too. A few bogosities in the history program were fixed. New features. None - this is a bugfix release. Documentation. Minor updates only. Tim Goodwin 2003-07-17 From rc-owner Thu Sep 4 13:29:37 2003 Received: from mailout.TechFak.Uni-Bielefeld.DE ([129.70.136.245]) by hawkwind.utcs.utoronto.ca with SMTP id <16098>; Thu, 4 Sep 2003 13:23:57 -0500 Received: from grimsvotn.TechFak.Uni-Bielefeld.DE (grimsvotn.TechFak.Uni-Bielefeld.DE [129.70.137.40]) by momotombo.TechFak.Uni-Bielefeld.DE (8.11.7+Sun/8.11.6/TechFak/2003/04/16/pk) with ESMTP id h829xfG26774 for ; Tue, 2 Sep 2003 11:59:42 +0200 (MEST) Received: from localhost (pk@localhost) by grimsvotn.TechFak.Uni-Bielefeld.DE (8.11.7+Sun/8.9.1) with SMTP id h829xfF00571 for ; Tue, 2 Sep 2003 11:59:41 +0200 (MEST) Message-Id: <200309020959.h829xfF00571@grimsvotn.TechFak.Uni-Bielefeld.DE> X-Authentication-Warning: grimsvotn.TechFak.Uni-Bielefeld.DE: pk owned process doing -bs X-Authentication-Warning: grimsvotn.TechFak.Uni-Bielefeld.DE: pk@localhost didn't use HELO protocol To: rc shell mailing list Subject: Re: non login "rc" needs customized environment In-reply-to: Your message of "Mon, 01 Sep 2003 20:09:31 CDT." <03Sep1.200938edt.16050@hawkwind.utcs.utoronto.ca> X-Organization: Uni Bielefeld, Technische Fakultaet X-Phone: +49 521 106 2902 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <569.1062496780.1@grimsvotn.TechFak.Uni-Bielefeld.DE> Date: Tue, 2 Sep 2003 05:59:41 -0500 From: Peter Koch Chris Siebenmann wrote > It's only things that want to start a full shell environment from > scratch without going through a login session that are in trouble. Exactly. And "fixing" rsh/ssh is not an option since it would break other shells' setups (and special-casing "rc" is even harder, I suppose). > And even then there are usually ways around the problem, for example > explicitly sourcing a setup file when you run something via rsh/ssh. That's true but it would force our users or ourselves to treat "rc" special. There are workarounds for almost every special application (e.g. cvs over ssh) but I was trying to find a solution general enough and as backwards compatible as possible. To keep the lightweight startup I did not switch to "always source .rcrc", but had that depend upon the shell level SHLVL, btw, indeed interacts with other shells, but the more "popular" ones (bash, tcsh, zah) all use this variable name. -Peter