From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29942 invoked from network); 12 Jan 2005 11:20:22 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 12 Jan 2005 11:20:22 -0000 Received: (qmail 7729 invoked from network); 12 Jan 2005 11:20:14 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 12 Jan 2005 11:20:14 -0000 Received: (qmail 14169 invoked by alias); 12 Jan 2005 11:19:59 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 20694 Received: (qmail 14157 invoked from network); 12 Jan 2005 11:19:58 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 12 Jan 2005 11:19:58 -0000 Received: (qmail 7410 invoked from network); 12 Jan 2005 11:19:58 -0000 Received: from smtp-out2.blueyonder.co.uk (195.188.213.5) by a.mx.sunsite.dk with SMTP; 12 Jan 2005 11:19:55 -0000 Received: from sc ([82.41.210.43]) by smtp-out2.blueyonder.co.uk with Microsoft SMTPSVC(5.0.2195.6713); Wed, 12 Jan 2005 11:20:27 +0000 Date: Wed, 12 Jan 2005 11:21:14 +0000 From: Stephane Chazelas To: Zsh hackers list Subject: FAQ and other shell syntax Message-ID: <20050112112114.GB11326@sc> Mail-Followup-To: Zsh hackers list Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.5.6i X-OriginalArrivalTime: 12 Jan 2005 11:20:27.0552 (UTC) FILETIME=[B7CBCA00:01C4F898] X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: * X-Spam-Status: No, hits=1.5 required=6.0 tests=RCVD_IN_SORBS autolearn=no version=2.63 X-Spam-Hits: 1.5 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 and SHELL may be updated so that further xterm/screen/vi... start the new shell instead of the login shell. [ -f $HOME/bin/zsh ] && { echo "Type Y to run zsh: \c" read line [ "$line" = Y ] && exec $HOME/bin/zsh -l } Not every shell/echo support '\c' Either use: printf 'Type Y to run zsh: ' or echo "Type Y to run zsh: " | tr -d '\12' read line if [ "x$line" = xY ]; then SHELL=$HOME/bin/zsh; export SHELL exec "$SHELL" -l fi regards, Stéphane