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

Passing parameters between noninteractive shells



Hello,

I have access to two version of zsh: /bin/zsh (v. 3.0.6) and $HOME/bin/zsh
(v.4.0.2). /bin/zsh is my login prompt and I am unable to change it.

So I have the following section at the beginning of
my .zshenv:

===============.zshrc================
if [[ $ZSH_VERSION == 3.<->* ]]; then
     if [[ -x $HOME/bin/zsh && -o interactive ]]; then
        exec $HOME/bin/zsh
     else 
       if [[ -x $HOME/bin/zsh && ! -o interactive ]]; then
         exec $HOME/bin/zsh +o interactive
       fi
     fi
fi
#
# A lot of specific ZSH 4.0.2 commands:
# [...] 
===============.zshrc================

With a such a solution switching between v3.0.6 and 4.0.2 passes with no
problem in the interactive sessions.  

The problem is with non-interactive sessions such as remote scp or cvs. This
configuration makes such sessions hang because a new zsh is run and it does not
know what it should do until I send 'exit' command. This is because the
new shell is not given any parameters that had been passed to the
previous instance of the shell - I believe so.

Is there any way to pass parameters of non-interactive sessions to new
instance of zsh? I would also appreciate another workarounds of that
problem. Making the whole .zshrc compatible with 3.0.6 is out of the
question.

Thank you in advance
Wojciech Pietron



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