* [9fans] how can I set path
@ 2011-03-25 4:18 流明
2011-03-25 4:23 ` Jacob Todd
` (2 more replies)
0 siblings, 3 replies; 12+ messages in thread
From: 流明 @ 2011-03-25 4:18 UTC (permalink / raw)
I'm new to plan9. i don't know how to set path on plan9, can you help me? thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.9fans.net/private/9fans/attachments/20110325/d06862f2/attachment.html>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [9fans] how can I set path
2011-03-25 4:18 [9fans] how can I set path 流明
@ 2011-03-25 4:23 ` Jacob Todd
2011-03-25 11:57 ` erik quanstrom
2011-03-25 15:42 ` Zhai
2 siblings, 0 replies; 12+ messages in thread
From: Jacob Todd @ 2011-03-25 4:23 UTC (permalink / raw)
You don't. You may want read /sys/doc/9.ps.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.9fans.net/private/9fans/attachments/20110325/24993429/attachment.html>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [9fans] how can I set path
2011-03-25 4:18 [9fans] how can I set path 流明
2011-03-25 4:23 ` Jacob Todd
@ 2011-03-25 11:57 ` erik quanstrom
2011-03-25 12:14 ` Lucio De Re
2011-03-25 15:42 ` Zhai
2 siblings, 1 reply; 12+ messages in thread
From: erik quanstrom @ 2011-03-25 11:57 UTC (permalink / raw)
> I'm new to plan9. i don't know how to set path on plan9, can you help me? thank you
for the record, you can set the path. e.g.
path=($path /some/other/directory)
the default path is (. /bin).
jaketodd and john correctly point out that this
isn't the way it's done; bind(1) is the preferred method.
rc (the shell) is the only program that respects $path.
in fact that would be a sneeky way to run programs
from the shell that can't be exec(2)'d.
- erik
^ permalink raw reply [flat|nested] 12+ messages in thread
* [9fans] how can I set path
2011-03-25 11:57 ` erik quanstrom
@ 2011-03-25 12:14 ` Lucio De Re
2011-03-25 12:27 ` erik quanstrom
0 siblings, 1 reply; 12+ messages in thread
From: Lucio De Re @ 2011-03-25 12:14 UTC (permalink / raw)
On Fri, Mar 25, 2011 at 07:57:36AM -0400, erik quanstrom wrote:
>
> for the record, you can set the path. e.g.
> path=($path /some/other/directory)
> the default path is (. /bin).
>
Probably because one doesn't want to bind "." to /bin for every
"." visited, not because it's a good idea.
> jaketodd and john correctly point out that this
> isn't the way it's done; bind(1) is the preferred method.
> rc (the shell) is the only program that respects $path.
> in fact that would be a sneeky way to run programs
> from the shell that can't be exec(2)'d.
>
I read that as allowing the shell to run programs that the kernel would
reject. I eventually understood it to mean that you can hide programs
where only the shell will find them. Is the current directory one of
those places, I wonder? I'm reluctant to figure it out for myself -
long day.
++L
^ permalink raw reply [flat|nested] 12+ messages in thread
* [9fans] how can I set path
2011-03-25 12:14 ` Lucio De Re
@ 2011-03-25 12:27 ` erik quanstrom
2011-03-25 13:53 ` roger peppe
0 siblings, 1 reply; 12+ messages in thread
From: erik quanstrom @ 2011-03-25 12:27 UTC (permalink / raw)
> I read that as allowing the shell to run programs that the kernel would
> reject. I eventually understood it to mean that you can hide programs
> where only the shell will find them. Is the current directory one of
> those places, I wonder? I'm reluctant to figure it out for myself -
> long day.
try this:
cd $home/tmp
cat > diff
#!/bin/rc
echo hi!
<EOT>
chmod a+x diff
history -D $somefile
diff $somefile `{yesterday $somefile}
- erik
^ permalink raw reply [flat|nested] 12+ messages in thread
* [9fans] how can I set path
2011-03-25 12:27 ` erik quanstrom
@ 2011-03-25 13:53 ` roger peppe
2011-03-25 13:58 ` roger peppe
0 siblings, 1 reply; 12+ messages in thread
From: roger peppe @ 2011-03-25 13:53 UTC (permalink / raw)
On 25 March 2011 12:27, erik quanstrom <quanstro at quanstro.net> wrote:
>> I read that as allowing the shell to run programs that the kernel would
>> reject. ?I eventually understood it to mean that you can hide programs
>> where only the shell will find them. ?Is the current directory one of
>> those places, I wonder? ?I'm reluctant to figure it out for myself -
>> long day.
>
> try this:
>
> ? ? ? ?cd $home/tmp
> ? ? ? ?cat > diff
> ? ? ? ?#!/bin/rc
> ? ? ? ?echo hi!
> ? ? ? ?<EOT>
> ? ? ? ?chmod a+x diff
> ? ? ? ?history -D $somefile
> ? ? ? ?diff $somefile `{yesterday $somefile}
>
i always set $path to (/bin .)
it can be much faster, apart from anything else.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [9fans] how can I set path
2011-03-25 13:53 ` roger peppe
@ 2011-03-25 13:58 ` roger peppe
0 siblings, 0 replies; 12+ messages in thread
From: roger peppe @ 2011-03-25 13:58 UTC (permalink / raw)
On 25 March 2011 13:53, roger peppe <rogpeppe at gmail.com> wrote:
> i always set $path to (/bin .)
> it can be much faster, apart from anything else.
% 9fs sources
% cd /n/sources
% echo $path
/bin .
% time rc -c '{for(i in `{seq 1 100}){echo $i}}' > /dev/null
0.01u 0.09s 0.27r rc -c {for(i in `{seq 1 100}){echo $i}}
% path=(. /bin)
% time rc -c '{for(i in `{seq 1 100}){echo $i}}' > /dev/null
0.00u 0.09s 12.20r rc -c {for(i in `{seq 1 100}){echo $i}}
%
^ permalink raw reply [flat|nested] 12+ messages in thread
* [9fans] how can I set path
2011-03-25 4:18 [9fans] how can I set path 流明
2011-03-25 4:23 ` Jacob Todd
2011-03-25 11:57 ` erik quanstrom
@ 2011-03-25 15:42 ` Zhai
2 siblings, 0 replies; 12+ messages in thread
From: Zhai @ 2011-03-25 15:42 UTC (permalink / raw)
On 3?25?, ??12?22?, 34261... at qq.com (??) wrote:
> I'm new to plan9. i don't know how to set path on plan9, can you help me? thank you.
?????????
?????????plan9??????
???????????
??QQ??Email??
???
^ permalink raw reply [flat|nested] 12+ messages in thread
* [9fans] how can I set path
@ 2011-03-25 4:33 流明
2011-03-25 4:36 ` John Floren
0 siblings, 1 reply; 12+ messages in thread
From: 流明 @ 2011-03-25 4:33 UTC (permalink / raw)
but i want to build inferno on plan9, i have to add /usr/glenda/inferno/Plan9/386/bin to my default path.
how can i do that?
>From: Jacob Todd <jaketodd422 at gma...>
>Subject: how can I set path
>Date: Fri, 25 Mar 2011 00:23:09 -0400
>You don't. You may want read /sys/doc/9.ps.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.9fans.net/private/9fans/attachments/20110325/147ae1dc/attachment.html>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [9fans] how can I set path
2011-03-25 4:33 流明
@ 2011-03-25 4:36 ` John Floren
0 siblings, 0 replies; 12+ messages in thread
From: John Floren @ 2011-03-25 4:36 UTC (permalink / raw)
bind -b /usr/glenda/inferno/Plan9/386/bin /bin
2011/3/24 ?? <34261454 at qq.com>:
> but i want to build inferno on plan9, i have to?add
> /usr/glenda/inferno/Plan9/386/bin to my default path.
> how can i do that?
>
>
>>From: Jacob Todd <jaketodd422 at gma...>
>>Subject: how can I set path
>>Date: Fri, 25 Mar 2011 00:23:09 -0400
>
>>You don't.? You may want read /sys/doc/9.ps.
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [9fans] how can I set path
@ 2011-03-25 4:40 Jacob Todd
0 siblings, 0 replies; 12+ messages in thread
From: Jacob Todd @ 2011-03-25 4:40 UTC (permalink / raw)
bind -a /usr/glenda/inferno/Plan9/386/bin /bin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.9fans.net/private/9fans/attachments/20110325/f6db4db2/attachment.html>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [9fans] how can I set path
@ 2011-03-25 4:42 流明
0 siblings, 0 replies; 12+ messages in thread
From: 流明 @ 2011-03-25 4:42 UTC (permalink / raw)
it does!
thank you very much!
>From: John Floren <john at jfl...>
>Subject: how can I set path
>Date: Thu, 24 Mar 2011 21:36:51 -0700
>bind -b /usr/glenda/inferno/Plan9/386/bin /bin
>2011/3/24 ????????? <34261454 at qq.com>:
>> but i want to build inferno on plan9, i have to? add
>> /usr/glenda/inferno/Plan9/386/bin to my default path.
>> how can i do that?
>>
>>
>>>From: Jacob Todd <jaketodd422 at gma...>
>>>Subject: how can I set path
>>>Date: Fri, 25 Mar 2011 00:23:09 -0400
>>
>>>You don't.? You may want read /sys/doc/9.ps.
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.9fans.net/private/9fans/attachments/20110325/9635b783/attachment-0001.html>
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2011-03-25 15:42 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-25 4:18 [9fans] how can I set path 流明
2011-03-25 4:23 ` Jacob Todd
2011-03-25 11:57 ` erik quanstrom
2011-03-25 12:14 ` Lucio De Re
2011-03-25 12:27 ` erik quanstrom
2011-03-25 13:53 ` roger peppe
2011-03-25 13:58 ` roger peppe
2011-03-25 15:42 ` Zhai
2011-03-25 4:33 流明
2011-03-25 4:36 ` John Floren
2011-03-25 4:40 Jacob Todd
2011-03-25 4:42 流明
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).