Re: [dev] [9base] /bin/rc

From: Ethan Grammatikidis <>
Date: Wed, 25 Aug 2010 02:51:07 +0100

On 2010-08-24 20:52:55 +0100 Kris Maglione <>

> On Tue, Aug 24, 2010 at 11:31:21PM +0400, anonymous wrote:
>> On page there are scripts that starts
>> with /bin/rc she-bang. Someone have also sent some script with
>> #!/bin/rc in it to this list.
>> So I want to ask what is the best way to put rc into /bin under
>> Linux.
>> Is there any options in plan9port or 9base that allow to install
>> non-conflicting utilities in /bin? Of course, I can just move 'rc'
>> into 'bin' using mv in my build script but maybe someone know any
>> better way?
>> Hope to get Kris reply, looks like he already use /bin/rc without
>> problems. Also strange that he uses #!/usr/bin/env rc in 'vp'.
> I just keep a statically linked copy there on all of my machines.
> There's
> nothing special about it. I used /usr/bin/env in vp because I expect
> that
> most other people don't have a copy there. I don't like to use
> /usr/bin/env
> because it might hit on Byron's incompatible rc, but it's the best
> shot at
> having scripts work everywhere.

I never thought of keeping a copy of rc in /bin. What I came up with
was an rc+ed script to modify that first line.[1] It itself launches
with /usr/bin/env, but it modifies every rc and awk script it finds
except itself so that the #! lines reference the rc and awk which were
in the path at the time it was run. That sounds complicated...

Basically, run it in a dir with rc and/or awk scripts and the rc and
awk you want to use in dirs at the head of path. It will fix the #!
lines. It searches recursively too. I've used it to fix plan9port
itself after a move, which p9p's own INSTALL won't do.

Received on Wed Aug 25 2010 - 03:51:07 CEST

This archive was generated by hypermail 2.2.0 : Wed Aug 25 2010 - 04:00:05 CEST