From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17432 invoked from network); 13 Oct 2002 21:49:10 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 13 Oct 2002 21:49:10 -0000 Received: (qmail 22685 invoked by alias); 13 Oct 2002 21:48:49 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5436 Received: (qmail 22671 invoked from network); 13 Oct 2002 21:48:46 -0000 Date: Sun, 13 Oct 2002 23:48:40 +0200 From: "Nadav Har'El" To: Philippe Troin Cc: alnesbit@optushome.com.au, zsh-users@sunsite.dk Subject: Re: All login shells are interactive? Message-ID: <20021013214840.GD22816@fermat.math.technion.ac.il> References: <871y6u1ava.fsf@ceramic.fifi.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <871y6u1ava.fsf@ceramic.fifi.org> User-Agent: Mutt/1.4i Hebrew-Date: 8 Heshvan 5763 On Sun, Oct 13, 2002, Philippe Troin wrote about "Re: All login shells are interactive?": > alnesbit@optushome.com.au writes: > > That's what the FAQ says, but I don't understand how this can be true. > > Surely you can have a non-interactive login shell, like, say > > > > zsh -l -c 'echo Non-interactive login shell' > > Yes indeed. And it is used by at least gnome-session and CDE when you > start an X session. Right. I even use this trick myself: my ~/.xsession file starts with a #!/bin/zsh -l line, so that it (and everything in it) gets run after zsh has read my ~/.zprofile, including all my enviroment variables (e.g., my PATH). This is why when I wanted my .zprofile to print a welcome message only for interactive login shells, I did something like this in .zprofile: # We print this message only in a shell which is both interactive and a login # shell. Alternatively we can move this message to zshrc, inside a test if $- # contains l (i.e., a login shell). case $- in *i*) print "*** $ZSH_NAME $ZSH_VERSION, $VENDOR $MACHTYPE" print -P "Welcome to %m, %D{%A}, %D{%e %B %Y}, %t.";; esac -- Nadav Har'El | Sunday, Oct 13 2002, 8 Heshvan 5763 nyh@math.technion.ac.il |----------------------------------------- Phone: +972-53-245868, ICQ 13349191 |Always remember you're unique, just like http://nadav.harel.org.il |everyone else.