From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <08e519c557d58126a26246dad433d182@quanstro.net> From: erik quanstrom Date: Wed, 8 Oct 2008 07:35:23 -0400 To: rudolf.sykora@gmail.com, 9fans@9fans.net MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] environment + functions Topicbox-Message-UUID: 18f85c06-ead4-11e9-9d60-3106f5b1d025 > > 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? ; i=0 ; @{i=1; sleep 2; echo $i} & @{i=2; sleep 1; echo $i} ; wait 2 1 ; ; cat /env/i 0; > (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.) sounds complicated. why do you need to define a function for each new directory? the prompt trick is sneaky. it relies on the space. why not just move the space and make the thing that required a new function an argument to a fixed function? fn $sysname: { } fn cd{ builtin cd $* awd prompt=($sysname:' '`{basename `{pwd}}^'; ' '') } or you can go minimilst bourne and have fn : { } fn cd{ bultin cd $* awd prompt=(': '`{basename `{pwd}}^'; ' '') } - erik