9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Martin Neubauer <m.ne@gmx.net>
To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu>
Subject: Re: [9fans] How to move to rc from sh/bash
Date: Sun, 10 Feb 2008 19:12:45 +0100	[thread overview]
Message-ID: <20080210181244.GA801@shodan.homeunix.net> (raw)
In-Reply-To: <41F23396-1019-4C8E-A65A-E42824B0E23B@mac.com>

* Pietro Gagliardi (pietro10@mac.com) wrote:
> - The seq statement is standard
> 	for (i in `{seq 1 10}) echo $i

Nope, seq is an external program (subject to the environment). On the other
hand, as Byron's rc is rather extinct by now, chances are if rc is available,
so is seq.

> - aux/getflags is faster than while getopt (no loop involved)
> 	My next plan is to rewrite all of /rc/bin to use aux/getflags. Any
> objections?

Well, that isn't so much about rc's advantages. Keep in mind though that
this would force getflags to be present whenever you need a shell script.
For most installations this isn't an issue, but for those running Plan 9
embedded it is. And with space constraints providing some of /rc/bin might
be reasonable, providing aux/getflags might not. Besides, if a script
doesn't use more than two or three different options getflags doesn't reduce
much complexity (if you aren't writing a new script). And concerning speed,
if command line parsing dominates the execution time I honestly wouldn't
bother.

> And what I dislike:
> - >[2=] is not the same as >[2]/dev/null (some programs crash with
> the former

I don't think it should be the same. Both are special cases for two
different operations.

But what's really great about rc:
% man bash | wc -l
    4898
% man rc | wc -l
     398
If I'd want to check the bash man page for some specific information,
chances are that I'm sound asleep before anything interesting comes up.

	Martin


  parent reply	other threads:[~2008-02-10 18:12 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-09  7:53 Hongzheng Wang
2008-02-09  8:01 ` mattmobile
2008-02-09  8:41   ` Hongzheng Wang
2008-02-09  8:57     ` mattmobile
2008-02-09  9:00 ` erik quanstrom
2008-02-09  9:21   ` Hongzheng Wang
2008-02-09 10:11 ` Charles Forsyth
2008-02-09 10:27   ` Lluís Batlle
2008-02-09 15:06     ` Uriel
2008-02-09 17:54     ` Charles Forsyth
2008-02-09 21:59       ` geoff
2008-02-09 13:00   ` Anthony Sorace
2008-02-10 16:59 ` Gorka Guardiola
2008-02-10 17:16   ` Pietro Gagliardi
2008-02-10 17:47     ` erik quanstrom
2008-02-10 18:12     ` Martin Neubauer [this message]
2008-02-11 15:04       ` erik quanstrom
2008-02-11 23:03         ` Martin Neubauer
2008-02-11 23:25           ` Pietro Gagliardi
2008-02-20 15:04             ` maht
2008-02-20 15:08               ` Federico G. Benavento
2008-02-20 15:24               ` erik quanstrom
2008-02-20 15:55                 ` maht
2008-02-11 23:59       ` Uriel
2008-02-12 11:57         ` Martin Neubauer

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=20080210181244.GA801@shodan.homeunix.net \
    --to=m.ne@gmx.net \
    --cc=9fans@cse.psu.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).