Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [[ -o interactive ]] vs if [[ -o login ]]?
- X-seq: zsh-users 16227
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: TJ Luoma <luomat@xxxxxxxxx>
- Subject: Re: [[ -o interactive ]] vs if [[ -o login ]]?
- Date: Mon, 15 Aug 2011 01:24:10 +0200
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=QlqcDoeui+lWbn0Y8pr2xKdhxxKgXVSekGXZNuVEh0Y=; b=cTtO46xK8G64+hq8F9+bVcajQ01q70IFx2SQGy0IjDrVf29NPFncRzTgF/2aKusjsB LWHg8WmzUYyiez1eStxl7hz3mL6qw0kmapPNzjxey7zf6+wumEQesu+3Z8Nm1y2m0Xra 2+MtZNpCFpfJmRHMphq2D1UNIf1Q7nhXIjrzg=
- In-reply-to: <CADjGqHtVSHJbdrHfJVR9T0uZ0my-Xb396-3k_ZA_fZgD24phdA@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>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CADjGqHtVSHJbdrHfJVR9T0uZ0my-Xb396-3k_ZA_fZgD24phdA@mail.gmail.com>
On 15 August 2011 00:46, TJ Luoma <luomat@xxxxxxxxx> wrote:
> If there any reason to prefer
>
> if [[ -o interactive ]]
>
> rather than
>
> if [[ -o login ]]
>
> ?
>
> Are they two ways of saying the same thing? If not, could someone
> explain the difference?
login is only set for login shells, interactive is set for all
interactive shells. I suspect that doesn't help you a lot though since
that part's pretty obvious ;). A login shell is something that is
started at the beginning of some sort of session, like logging in to X
or the console, and it will be started like $SHELL -l or -$SHELL (with
a - prepended to argv[0]). Any time you just open a terminal or run
"zsh" it is likely not a login shell, unless you configure your
terminal emulator to always start a login shell.
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author