zsh-users
 help / color / mirror / code / Atom feed
From: "Nikolay Aleksandrovich Pavlov (ZyX)" <kp-pav@yandex.ru>
To: Anthony Fletcher <anthony@bifb.org>,
	"zsh-users@zsh.org" <zsh-users@zsh.org>
Subject: Re: allow zsh to source a script and then become interactive
Date: Sat, 15 Apr 2017 01:41:51 +0300	[thread overview]
Message-ID: <4642151492209711@web5m.yandex.ru> (raw)
In-Reply-To: <20170414165548.GA13756@teapot.bifb.org>

14.04.2017, 19:57, "Anthony Fletcher" <anthony@bifb.org>:
> This is an oldie but goodie that I don't have a solution to. How can I
> invoke a zsh that sources a particular file (not the standard start up
> files) and then become interactive, preserving functions, etc?
>
> This is akin to the ksh invocation:
>
>  ENV=startup ksh
>
> or bash's
>
>  bash --rcfile startup
>
> One solution was covered in 2005 by Bart: see
> http://www.zsh.org/mla/users/2005/msg00600.html However this only works
> if you can change the .zshrc file.
>
> Another alternative is to create a custom .zshrc in a temporary
> directory and set the environment variable ZDOTDIR. But this is a little
> clunky.
>
> I look after an increasing disparate collection of systems and I'd
> like to launch a customised zsh on a remote system without changing
> anything ahead of time.
>
> Any ideas or should we propose a --rcfile option to zsh?
>
>                 Anthony.

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.


  parent reply	other threads:[~2017-04-14 22:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-14 16:55 Anthony Fletcher
2017-04-14 20:28 ` Bart Schaefer
2017-04-14 22:03   ` Anthony Fletcher
2017-04-15  1:00     ` Daniel Shahaf
2017-04-15  2:45       ` Bart Schaefer
2017-04-15 15:40         ` Daniel Shahaf
2017-04-15 19:06           ` Anthony Fletcher
2017-04-14 22:41 ` Nikolay Aleksandrovich Pavlov (ZyX) [this message]
2017-04-14 23:14   ` Bart Schaefer
2017-04-14 23:39     ` Anthony Fletcher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4642151492209711@web5m.yandex.ru \
    --to=kp-pav@yandex.ru \
    --cc=anthony@bifb.org \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).