On Wed, Apr 18, 2012 at 02:27, David Korn <[email protected]> wrote:

> cc: [email protected]
> Subject: Re: [ast-users] [ksh93] Any way to get the full file name of
> current  running ksh?
> --------
> >
> > Bash has a $BASH var for this purpose so I can define following alias to
> > reload the rc files without exiting and restarting the shell:
> >
> >   alias rr='echo "+++ Restarting $BASH ..."; exec $BASH'
> >
> > (attachment  1     7/299                text/html "1.att")
> >
>
> It will exit and restart bash, using the same process id.
>

By "exit" I mean typing "exit<CR>" or CTRL-D from the ksh shell. By
"restart" I mean typing "ksh<CR>" from the bash shell (that's my login
shell). I just want to save a few keystrokes. :)

>
> I am not sure that it is possible to get the pathname for the
> current process on all systems.
>
> However for linux, and some other systems
>        /proc/$$/exe
> is a symlink to the pathname of the current process so
>        ME=$(ls -l /proc/$$/exe)
>        ME=${ME#*-\> }
> will give the pathname for ksh (the current process and
>        alias rr='echo "+++ Restarting $ME ..."; exec $ME'
> will do the same as your rr alias.
>

I don't want it to be that complicated since I have Solaris, Mac OS X and
Linux systems. For now I just use `exec ksh' since the ksh delivered with
the OS is the one I play with for most of the time. But for bash I always
use the latest version I compiled from source code.

>
> David Korn
> [email protected]
>
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users

Reply via email to