From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: Date: Wed, 8 Oct 2008 12:58:26 +0200 From: "Rudolf Sykora" To: "Fans of the OS Plan 9 from Bell Labs" <9fans@9fans.net> In-Reply-To: <14ec7b180810071152i1dcdc311la333bfc3e737729d@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_60746_15697533.1223463506609" References: <14ec7b180810071152i1dcdc311la333bfc3e737729d@mail.gmail.com> Subject: Re: [9fans] environment + functions Topicbox-Message-UUID: 18c441aa-ead4-11e9-9d60-3106f5b1d025 ------=_Part_60746_15697533.1223463506609 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline > > it's done this way, i believe, to ensure that two rc shells running in > the same namespaces do not step all over each others' environments. if > you simply run 'rfork e' before you experiment with all those > functions you won't see the empty files anywhere. Sorry, but I don't understand... Could you give me some example? > last note: once you've deleted the function with the 'fn' builtin > you're free to remove the corresponding file in /env: it won't matter > anymore. i'm sure rc can be changed to delete the file. > So, if I continuously want to add and remove functions within one shell (running hypothetically forever), do I have to 'manually' delete those empty left-behind files? --- that is, not only use fn name_that_I _don't_need but also rm /env/'fn#name_that_I _don't_need' ? (I was playing with this to have a prompt that reflects the last part of my current directory. Following the example of setting fn term% { $*} I, whenever I change a directory, define a similar function with an appropriate name. When I change the directory again I do the same for the new one, but also want to get rid of the old one... -- actually in the opposite order.) Ruda ------=_Part_60746_15697533.1223463506609 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
it's done this way, i believe, to ensure that two rc shells running in
the same namespaces do not step all over each others' environments. if
you simply run 'rfork e' before you experiment with all those
functions you won't see the empty files anywhere.
 
Sorry, but I don't understand... Could you give me some example?
 
last note: once you've deleted the function with the 'fn' builtin
you're free to remove the corresponding file in /env: it won't matter
anymore. i'm sure rc can be changed to delete the file.

So, if I continuously want to add and remove functions within one shell (running hypothetically forever), do I have to 'manually' delete those empty left-behind files? --- that is, not only use
fn name_that_I _don't_need
but also
rm /env/'fn#name_that_I _don't_need' ?

(I was playing with this to have a prompt that reflects the last part of my current directory. Following the example of setting fn term% { $*} I, whenever I change a directory, define a similar function with an appropriate name. When I change the directory again I do the same for the new one, but also want to get rid of the old one... -- actually in the opposite order.)

Ruda
------=_Part_60746_15697533.1223463506609--