From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21490 invoked by alias); 18 Nov 2014 16:12:34 -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: 19400 Received: (qmail 8631 invoked from network); 18 Nov 2014 16:12:32 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=OHKNubOkG6MdO8RrpaS0d5Yfe3sJw+9jUVqSdsU5+Zc=; b=cgZaEot+HzmQhvs356BfXDfm/+7bIDBFSscEdSxhL+ZasI4iKHn7sq4dZLkWcSZ0lQ /zlWp3TrnjkneAilnNCMpq3q+3+wVemgEDb8R5e9/DI0g1LD7y6dx4egkydZfyAtZJRE EWXxttPeQIPdLsm2GI9nkxnKE30+RBvu4nXZRl0EhDP4nI2OMhO+2+PBJPf1KamFWXAN BfgYuXJsGtQMeHViVWDGIr3G7aaiE9cUq4A9Vq0+/A8opWMe+6Wf/TPMN27Fj2qRuVxz ajY100OV/Otd2FvDAufP/upjsUjeHiyfVlOM2do86rrb+mtITNeNp+jsndeCical0WV/ YkSQ== X-Received: by 10.70.135.41 with SMTP id pp9mr38427004pdb.77.1416327146923; Tue, 18 Nov 2014 08:12:26 -0800 (PST) MIME-Version: 1.0 From: TJ Luoma Date: Tue, 18 Nov 2014 11:11:46 -0500 Message-ID: Subject: 'login' vs 'interactive' ? To: Zsh-Users List Content-Type: text/plain; charset=UTF-8 1) Can someone explain the difference between 'login' and 'interactive' in these two examples: if [[ -o login ]]; then echo "I'm a login shell" fi if [[ -o interactive ]]; then echo "I'm interactive" fi 2) is 'login' vs 'interactive' similar to "every square is a rectangle but a rectangle is not necessarily a square"? As in "Every login shell is interactive, but an interactive shell is not necessarily a login shell"? 3) Imagine an alternate universe where zsh _automatically_ reads ~/.zshenv but NOT ~/.zshrc so you had to tell zsh to read ~/.zshrc as part of ~/.zshenv. Would the answer be: if [[ -o login ]]; then source .zshrc fi or if [[ -o interactive ]]; then source .zshrc fi or does it matter? 4) Anything else I should understand about these two? Thanks! TjL ps - I swear I knew the answer to this at one time, but I can't remember it, nor has Google helped me find the answer.