rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
From: Boyd Roberts <boyd@prl.dec.com>
To: rc@archone.tamu.edu
Subject: Re: 'access' builtin for rc?
Date: Thu, 1 Aug 1991 03:40:33 -0500	[thread overview]
Message-ID: <9108011040.2131.rc.baden@prl.dec.com> (raw)
In-Reply-To: <9108010712.AA28450@margay.cs.wisc.edu>

    I propose adding (perhaps conditionally) a new builtin for rc to
    perform the most common functions of "test" for examining the file
    system.  I have in mind those operations I would use "test" for that
    are nothing more than an access() or a stat().

No way.  NO WAY!  _NO WAY_!!

    There are three reasons I am proposing this.

    1) Currently it takes rc about 15 seconds to start up with my current
    .rcrc, mostly because I'm doing things like testing whether directories
    exist before I put them into my path.

    I agree it's possible to test this sort of thing without a builtin, but
    using /bin/test makes things sooooooo slow in my startup.

Hack your .rcrc so it's not so bloated or get a faster cpu.  `test' does
_not_ belong in the shell.  I thought we knew that from as far back as V6.
Back when programs were small and fast and CPUs were slow.

On my 3max it takes 0.4s (real & 0.0s cpu) to start rc and 1.6s (real & 0.4s
cup) to process my .rcrc, and it's bloated to 181 lines of system imposed crap
and 61 lines of personal stuff.  Getting a `rc -l' in an xterm is damn near
instantaneous, once X decides to give me a window.

Just what _have_ you got in your .rcrc?

    2) There is "prior art".  Many other shells have implemented "test" as
    a builtin, for performance reasons.  I am not proposing for rc anything
    so complicated as "test", since rc already has ways to examine strings
    and process boolean expressions.

Other shells, written by bozos included `test'.  Look at that System V mess.
Look at the hideous `type' command.  Couldn't code `whatis', but they built
`test' into the shell.

Don't start me on the Korn shell, jesus!  `typeset'...  $RANDOM... puke!

    3) Byron wanted to see what the opinion of the mailing list would be.

    So, I propose the following builtin command:

    	access [-rwxaefdbcplguk] path ...

No, we already have test.  Why have another `test'?

    Possible other options (getting into feeping creaturism here):

Features?  It's already got to many.  What about a:

	-C 	Compile the arguments to C    and execute.
	-L	  "      "      "     "  lisp  "     "

Just where will it all end?

If you really want this abortion, code it up and stick it in your bin.
NOT IN THE SHELL.  ANYWHERE, BUT IN THE SHELL!!!

I CANNOT SAY THIS TOO STRONGLY:

    _LEAVE THE FUCKING SHELL ALONE_!!!!!
    
I DON'T WANT ksh/csh/tcsh IN rc.  I WANT rc.  THAT'S ALL!!  NO MORE, NO LESS!!

    My impression (having just thought it up) is that "access" is simple,
    small, clean, and consistent (hopefully in the style of rc), and offers
    quite a performance improvement for common tests.

How can it possibly be `simple' with 19 options?  Are you trying to rival `ls'?
`simple, small, clean, ...' blah blah blah that's what's always used to defend
just about any hack.  `gross, foul and unneccessary' is more like it.

Make it a command, and keep it out of the shell.


  reply	other threads:[~1991-08-01  9:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1991-08-01  7:12 DaviD W. Sanderson
1991-08-01  8:40 ` Boyd Roberts [this message]
1991-08-01 14:13   ` Hamish Macdonald
1991-08-01 21:35   ` Dave Mason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9108011040.2131.rc.baden@prl.dec.com \
    --to=boyd@prl.dec.com \
    --cc=rc@archone.tamu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).