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

Re: allow zsh to source a script and then become interactive



On 14 Apr 2017 at 16:14:45, Bart Schaefer wrote:
> On Apr 15,  1:41am, Nikolay Aleksandrovich Pavlov (ZyX) wrote:
> }
> } I tried to play with
> } `ENV==(<<< $'emulate zsh\necho abc') ARGV0=sh zsh`,
> } but apparently this does not work: e.g. I do not see `$path` variable
> } in this case, though I do see `abc`. Guess $ENV is too late to
> } switch emulation mode and have all necessary initialization steps be
> } performed.
> 
> Using "emulate" only changes setopts, it doesn't re-initialize other
> state that would be in place before the startup files are sourced.
> 
> Good idea, though -- it might work for Anthony's case.  I'd recommend
> "emulate -R zsh" for more thorough option reset.

Sadly not. One of my start-up files contains

  typeset -U path PATH
  path[(r).]=() 

and this gives the error "path: attempt to assign array value to
non-array". So it isn't completely in zsh mode. Playing further I
provoked a segmentation fault! This dies:

   ARGV0=sh zsh -c 'typeset -U path PATH'

(zsh version 5.2.6 on Fedora).

			Anthony.



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