From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9244 invoked by alias); 14 Apr 2017 22:52:39 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 22666 Received: (qmail 3661 invoked from network); 14 Apr 2017 22:52:39 -0000 X-Qmail-Scanner-Diagnostics: from forward2h.cmail.yandex.net by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(87.250.230.17):SA:0(-3.5/5.0):. Processed in 2.220228 secs); 14 Apr 2017 22:52:39 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-3.5 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_PASS,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: kp-pav@yandex.ru X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf-ipv4.yandex.ru designates 87.250.230.17 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1492209711; bh=NmeOeve0Y/f6nmQlwQS64MnWniMiKXxZr6qQIr+xzok=; h=From:To:In-Reply-To:References:Subject:Message-Id:Date; b=cuJYosLN3OYcqcD7ejPAjJd4nM8nSVpc1wq2i5Y6vYQhbCsTPn6pxnv12Lomf12zm HVV9ISGHvUoBVZWG318UgrPSmXopZKKk+1q3mGO59ktGE5nvIqEOg9GENO4p/0N75U aaIi+njSI9/lSTV6ij0dIVmk5ctP3k1ORIvreBJA= Authentication-Results: mxback1o.mail.yandex.net; dkim=pass header.i=@yandex.ru From: "Nikolay Aleksandrovich Pavlov (ZyX)" To: Anthony Fletcher , "zsh-users@zsh.org" In-Reply-To: <20170414165548.GA13756@teapot.bifb.org> References: <20170414165548.GA13756@teapot.bifb.org> Subject: Re: allow zsh to source a script and then become interactive MIME-Version: 1.0 Message-Id: <4642151492209711@web5m.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Sat, 15 Apr 2017 01:41:51 +0300 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=utf-8 14.04.2017, 19:57, "Anthony Fletcher" : > 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.