Hi!

----

[Sorry for the late reply, this one was apparently rotting in my
Drafts/-folder for a long time... ;-( ]

Tim Bray wrote:
> On Aug 8, 2007, at 10:56 AM, Richard Elling wrote:
> > pushd/popd and dirs came from csh.  They are invaluable when you only
> > had a terminal.  They are so invaluable that ksh code to implement
> > them
> > is on pp 244-247 of "The Kornshell Command and Programming
> > Language" by
> > Bolsky and Korn, ISBN 0-13-516972-0.
> 
> Right, well, I have a 24" screen with (at this moment in time) 3
> terminals active, all of which have several directories pushed.
> 
> I'm not religious about shells.  I am *passionate* that when we
> manage to get a Linux/OS-X user to try Indiana, they don't get rude
> shocks in the first three minutes because some basic piece of
> infrastructure that's wired into their muscle memory doesn't work.
> 
> If I get on Solaris and !! or !prefix-of-some-previous-command or
> pushd/popd doesn't work, *that's a bug*.  I don't want to micromanage
> how we fix it.   -Tim

Erm, technically the problem of "pushd/"popd" is that several shells
define "pushd" and "popd" with slightly different functionality/options
and there is no POSIX specification which could be used as guidance
(neither is it possible to just tack-on some functions to the shell
without checking whether this is allowed by the POSIX shell spec) ...

... but for interactive ksh93 sessions the solution is AFAIK quite easy:
ksh93 has a feature called "FPATH" which specifies a path (similar like
the "PATH" variable) from which shell functions can be loaded
dynamically at runtime. For ksh93 shipped with Solaris >= 11/B72 in
interactive mode this could be used to load the matching functions
"pushd"/"popd"/"dirs" from /usr/demo/ksh/fun/ via adding a
-- snip --
FPATH+="/usr/demo/ksh/fun/"
-- snip --
to /etc/ksh.kshrc

BTW: As a mid- or long-term project we'd like to add a larger shell
function library at the /usr/lib/shell/ksh/ directory (see CR 6601968
("RFE: Add /usr/lib/shell/ksh/ as a place to store loadable shell
functions")) which would move "pushd"/"popd"/"dirs" out of the demo
directory to something like /usr/lib/shell/ksh/org/opensolaris/dirutil/
, giving non-interactive shell scripts a permanent location they can
rely on.

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) [EMAIL PROTECTED]
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 7950090
 (;O/ \/ \O;)
_______________________________________________
indiana-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/indiana-discuss

Reply via email to