rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
* say what you mean
@ 1991-09-30 16:06 Byron Rakitzis
  1991-10-01 14:36 ` interactive cd Paul D. Swasey
  0 siblings, 1 reply; 2+ messages in thread
From: Byron Rakitzis @ 1991-09-30 16:06 UTC (permalink / raw)
  To: rc

If you want to exec ./foo/bar, then why don't you type

	./foo/bar

I don't see why

	foo/bar

should automatically default to ./foo/bar even if you don't have . in
your path. Presumably . is not in your path for security purposes. If
so, it seems even more reasonable to not override $path in this way.

I'm sorry to get so defensive, but rc is not sh. The rule is very
simple and imho more intuitive than sh's. If the pathname is
"absolute", i.e., beginning with /, ./, or ../, then no path searching
is done. What is so complicated about that?



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

* interactive cd
  1991-09-30 16:06 say what you mean Byron Rakitzis
@ 1991-10-01 14:36 ` Paul D. Swasey
  0 siblings, 0 replies; 2+ messages in thread
From: Paul D. Swasey @ 1991-10-01 14:36 UTC (permalink / raw)
  To: rc

After using Bash then ksh for such a while, I find myself missing the
symbolic link following done by those shells...  So I wrote a version
of cd that maintained it's own version of the working directory and
handled cd .. by hacking that version the cd'ing to the result
(talking about rc functions, not C).

After a little use, I realized I had forgotten about cdpath.  I am now
stuck.   I wanted to give the same interface as builtin cd and was
counting on it to loop through cdpath for me (a hi-level loop here is
*slow*) ... I was using something like dir = `{builtin cd $1}
...thinking dir would be () if $1 was in the current directory or dir
would be the new absolute path of $cwd (the variable holding the
working directory).  Of course, `{ } invokes a non-interactive
subshell and builtin cd doesn't print the directory if cdpath is
used...oops

My question is do you think it's "right" to add a my_chdir() to rc
that deals with ..  `correctly'?  (It would only be a run-time option,
of course).  My original intent was to make a function to use
interactivley ... not touching the correct semantics of cd.  Now that
I've started writing my_chdir, I'd like to know if anything like it
will ever be in the official rc, given that such a "feature" is a
possible source of confusion:

; ENV=() ksh
Switching to new tty driver...
$ cd ; ls
Emacs           OldFiles        docs            lib             src
u		Mailbox         bin             include         man
tmp
$ cd bin; /bin/pwd
/afs/andrew.cmu.edu/usr16/ps3u/.depot/pmax_ul4/bin
$ more ../tmp/*
../tmp/: No such file or directory
$ ls ~/tmp
bash                    forth                   netrek_scoutiness
nt_servers		unix			client
guest_list              nt_clients		to_handle
$


Is anyone interested in the function or (when I finish it -- not
today, I'm tired) the code?

-dave

ps3u+@andrew.cmu.edu
R746PS3U@VB.CC.CMU.EDU


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

end of thread, other threads:[~1991-10-01 14:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1991-09-30 16:06 say what you mean Byron Rakitzis
1991-10-01 14:36 ` interactive cd Paul D. Swasey

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