Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
FAQ and other shell syntax
- X-seq: zsh-workers 20694
- From: Stephane Chazelas <Stephane_Chazelas@xxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxxxxx>
- Subject: FAQ and other shell syntax
- Date: Wed, 12 Jan 2005 11:21:14 +0000
- Mail-followup-to: Zsh hackers list <zsh-workers@xxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author