Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: The best way to know it is in zsh or bash
- X-seq: zsh-users 24220
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Peng Yu <pengyu.ut@xxxxxxxxx>
- Subject: Re: The best way to know it is in zsh or bash
- Date: Fri, 6 Sep 2019 17:16:52 +0200
- Cc: zsh-users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=XM2uzNQiq6sPADvE8YqLPzh0KvOkzA9xIdM85foCDN0=; b=CykDhNXCTrJMZFDzx6Q/EBX7YwM6VUkQPRxVqXLauR0KnIeGA/VGYr5W9KZrvsYbOn uR0BU6WFTlro8Gi5RhJrTL6tPZXy3nvnPIf6jdQX76tVFdmDm+dcaAL/agoqSe6uhWuX 8ByxJ551ONLU5uIcDjHMqKPXocOa0H9NZUp4DN0pnnbSBHYTqbqXWe9okTt7Wcli8sT3 g1xQB4W9ulAQpd+M/n8+vFn8jBSV9bssiEwGBsweaKRQdlhZMvDWyW/yDpp+YCA70asb iBaigXKQGtJvSRYQHfryPsHF6m4fbBvuo2Kn2rEOXrxchq/bkZuPDLIwvKWoy2XSjTbJ Wmug==
- In-reply-to: <CABrM6w=5V8VnJcX0SNj0s8+EpyJWFqN7EYTYc51rNpTYQ_p9vw@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CABrM6w=5V8VnJcX0SNj0s8+EpyJWFqN7EYTYc51rNpTYQ_p9vw@mail.gmail.com>
On 9/6/19, Peng Yu <pengyu.ut@xxxxxxxxx> wrote:
> Suppose that I start with bash default login shell, then I call zsh.
>
> I'd like to determine whether I am in bash or zsh. I see ZSH_*
> environment variables. Is ZSH_VERSION the most appropriate to be used
> to test whether it is in zsh or not? Thanks.
>
> $ declare -p BASH_VERSION
> declare -- BASH_VERSION="5.0.0(1)-release"
> $ declare -p ZSH_VERSION
> typeset ZSH_VERSION=5.6.2
autotools configure does this, so presumably it works fairly universally,
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author