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

Re: Switching shell safely and efficiently



Bart Schaefer (schaefer@xxxxxxxxxxxxxxxx) wrote:
>     run_shell=`$myshell -c "echo exec $myshell" || echo :`
>     eval $run_shell '"$@"'

Cute trick!  Nice enough to put in the FAQ, I think.  Although much
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:

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

I haven't done any benchmarking of the different approaches though.



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