Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Switching shell safely and efficiently



On Sep 7, 11:45pm, Adam Spiers wrote:
> Subject: Re: Switching shell safely and efficiently
> Bart Schaefer (schaefer@xxxxxxxxxxxxxxxx) wrote:
> >     run_shell=`$myshell -c "echo exec $myshell" || echo :`
> >     eval $run_shell '"$@"'

Now that I think about it, that could be just:

  eval `$myshell -c "echo exec $myshell" || echo :` '"$@"'

> more stylish than my attempt, it's not quite as efficient through
> having to fork the shell before running it properly.  To this end, a
> slight improvement might be skipping start-up files

I knew you were going to say that.

I chose to omit the -f in case the contents of the startup files are what
causes the shell to fail.  You did want safety ...



Messages sorted by: Reverse Date, Date, Thread, Author