From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Sun, 10 Feb 2008 19:12:45 +0100 From: Martin Neubauer 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 Message-ID: <20080210181244.GA801@shodan.homeunix.net> References: <599f06db0802100859l2a13a8e7o9d6a492138d44421@mail.gmail.com> <41F23396-1019-4C8E-A65A-E42824B0E23B@mac.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41F23396-1019-4C8E-A65A-E42824B0E23B@mac.com> User-Agent: Mutt/1.4.2.3i Topicbox-Message-UUID: 4ef0e108-ead3-11e9-9d60-3106f5b1d025 * 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