rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
* Re: rc 1.5
@ 1993-04-17 16:47 Alan Watson
  0 siblings, 0 replies; 6+ messages in thread
From: Alan Watson @ 1993-04-17 16:47 UTC (permalink / raw)
  To: David J. Fiander; +Cc: rc

[Re flags:]
> It's also there so scripts can change flags.  I would like to
> be able to write scripts that turn on the -x flag internally,
> when their debug flag is specified on the command line.

I would also find this useful, especially for debugging functions.

> Actually, /bin/sh, /bin/ksh, and the POSIX.2 shell all check
> the current directory for a file named "test", and _then_
> search the path for a file named "test" which is also
> executable.

None of the Bourne derivatives (sh, sh5, ksh, and bash) behave that way
on this machine (Decstation running Ultrix 4.3); the only ones which
get it `right' are the csh derivatives (csh and tcsh).

> The reason I would like "." to search the path is that then I
> can create the directory /usr/bin/rclib, and store
> scripts in there.  Then my scripts can just say
> 
>	 . rclib/read
> 
> to load the read function that I have stored there.

Try:
	rclib = /usr/bin/rclib
	. $rclib/read


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: rc 1.5
  1993-04-17 11:51 ` David J. Fiander
@ 1993-04-19 11:59   ` Chet Ramey
  0 siblings, 0 replies; 6+ messages in thread
From: Chet Ramey @ 1993-04-19 11:59 UTC (permalink / raw)
  To: davidf; +Cc: rc

> Actually, /bin/sh, /bin/ksh, and the POSIX.2 shell all check
> the current directory for a file named "test", and _then_
> search the path for a file named "test" which is also
> executable.

This is not true, except in some older versions of sh.  Current
versions of sh do not do it; I don't think ksh ever did.  Posix.2
specifies that only a path search is performed.  The current directory
is not searched unless it is in $PATH ``to avoid introducing
suceptibility to trojan horses that a user might be trying to avoid by
leaving `.' out of $PATH.''

Chet

--
``The ballpark is quiet now, save for the sound of droplets landing.  That
  is as it should be.  For today there are two fewer boys of summer.''

Chet Ramey, Case Western Reserve University	Internet: chet@po.CWRU.Edu


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: rc 1.5
@ 1993-04-17 16:56 Paul Haahr
  0 siblings, 0 replies; 6+ messages in thread
From: Paul Haahr @ 1993-04-17 16:56 UTC (permalink / raw)
  To: alan; +Cc: rc

> > The reason I would like "." to search the path is that then I
> > can create the directory /usr/bin/rclib, and store
> > scripts in there.  Then my scripts can just say
> >	. rclib/read
> > to load the read function that I have stored there.

> Try:
> 	rclib = /usr/bin/rclib
> 	. $rclib/read

other alternatives:

	fn load {
		for (i in $*) . /usr/bin/rclib/^$i
	}
	load read

	es and autoloading of shell functions :-)

paul


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: rc 1.5
  1993-04-16 22:21 Byron Rakitzis
@ 1993-04-17 11:51 ` David J. Fiander
  1993-04-19 11:59   ` Chet Ramey
  0 siblings, 1 reply; 6+ messages in thread
From: David J. Fiander @ 1993-04-17 11:51 UTC (permalink / raw)
  To: Byron Rakitzis; +Cc: rc

>That's a good question. I'm hoping to freeze rc. I also don't feel
>the need to bring rc "into line" with anything else. So offhand I
>would say no. The flag command is present in plan9 rc for a very
>specific reason (/lib/rcmain).

It's also there so scripts can change flags.  I would like to
be able to write scripts that turn on the -x flag internally,
when their debug flag is specified on the command line.

>And I don't want dot to search
>my path. 

[deletion]

>and "." is at the end of my path? Does this mean I run /bin/test
>as rc input? (THIS IS WHAT /bin/sh ACTUALLY DOES!!)

Actually, /bin/sh, /bin/ksh, and the POSIX.2 shell all check
the current directory for a file named "test", and _then_
search the path for a file named "test" which is also
executable.

The reason I would like "." to search the path is that then I
can create the directory /usr/bin/rclib, and store
scripts in there.  Then my scripts can just say

	. rclib/read

to load the read function that I have stored there.

- David


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: rc 1.5
@ 1993-04-16 22:21 Byron Rakitzis
  1993-04-17 11:51 ` David J. Fiander
  0 siblings, 1 reply; 6+ messages in thread
From: Byron Rakitzis @ 1993-04-16 22:21 UTC (permalink / raw)
  To: davidf; +Cc: rc

>Will 1.5 be brought into line with the Plan 9 man page?

That's a good question. I'm hoping to freeze rc. I also don't feel
the need to bring rc "into line" with anything else. So offhand I
would say no. The flag command is present in plan9 rc for a very
specific reason (/lib/rcmain). And I don't want dot to search
my path. What if I do:

	; cat >test <<EOF
	garbage
	EOF
	; . test

and "." is at the end of my path? Does this mean I run /bin/test
as rc input? (THIS IS WHAT /bin/sh ACTUALLY DOES!!)

No thank you.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: rc 1.5
  1993-04-16 19:14 Memory leaking Byron Rakitzis
@ 1993-04-16 22:04 ` David J. Fiander
  0 siblings, 0 replies; 6+ messages in thread
From: David J. Fiander @ 1993-04-16 22:04 UTC (permalink / raw)
  To: Byron Rakitzis; +Cc: rc

>From:  Byron Rakitzis <byron@netapp.com>
>The insignificant [memory leaks] will be fixed in 1.5.

Will 1.5 be brought into line with the Plan 9 man page?  Things
like the flag command and having the "." command search the
path?

- David


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~1993-04-19 12:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1993-04-17 16:47 rc 1.5 Alan Watson
  -- strict thread matches above, loose matches on Subject: below --
1993-04-17 16:56 Paul Haahr
1993-04-16 22:21 Byron Rakitzis
1993-04-17 11:51 ` David J. Fiander
1993-04-19 11:59   ` Chet Ramey
1993-04-16 19:14 Memory leaking Byron Rakitzis
1993-04-16 22:04 ` rc 1.5 David J. Fiander

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).