From: Alexandre Duret-Lutz <adl@src.lip6.fr>
To: Zsh hackers list <zsh-workers@sunsite.dk>
Subject: Re: FAQ and other shell syntax
Date: Wed, 12 Jan 2005 13:22:24 +0100 [thread overview]
Message-ID: <20050112122224.GA1560@src.lip6.fr> (raw)
In-Reply-To: <20050112112114.GB11326@sc>
On Wed, Jan 12, 2005 at 11:21:14AM +0000, Stephane Chazelas wrote:
> read at
> http://zsh.sunsite.dk/FAQ/zshfaq01.html#l8
>
> [ x$ZSH_VERSION = x -a -f $HOME/bin/zsh ] && exec $HOME/bin/zsh -l
>
> It should be noted that contrary to zsh, other shells need their
> variables to be quotes (my home dir is "/home/Stephane Chazelas").
>
> if [ -z "$ZSH_VERSION" ] \
> && [ -f "$HOME/bin/zsh" ] \
> && [ -x "$HOME/bin/zsh" ]; then
> SHELL=$HOME/bin/zsh; export SHELL
> exec "$SHELL" -l
> fi
I find it safer to actually try running `zsh --version' rather than
using -f and -x. First, because `test -x' is not supported
everywhere. Second, because `exec zsh' might fail badly if some
shared library is missing.
I have the following in my .tcshrc:
# ...
# skip remaining setup if not an interactive shell
if ($?USER == 0 || $?prompt == 0) exit
# ...
# Is there a working zsh in PATH?
(zsh --version) >&/dev/null && exec zsh
# Otherwise try know locations.
(/bin/zsh --version) >&/dev/null && exec /bin/zsh
(/usr/bin/zsh --version) >&/dev/null && exec /usr/bin/zsh
(obviously that would look better with SHELL and -l)
prev parent reply other threads:[~2005-01-12 12:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-12 11:21 Stephane Chazelas
2005-01-12 12:22 ` Alexandre Duret-Lutz [this message]
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=20050112122224.GA1560@src.lip6.fr \
--to=adl@src.lip6.fr \
--cc=zsh-workers@sunsite.dk \
/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).