zsh-workers
 help / color / mirror / code / Atom feed
* FAQ and other shell syntax
@ 2005-01-12 11:21 Stephane Chazelas
  2005-01-12 12:22 ` Alexandre Duret-Lutz
  0 siblings, 1 reply; 2+ messages in thread
From: Stephane Chazelas @ 2005-01-12 11:21 UTC (permalink / raw)
  To: Zsh hackers list

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-01-12 12:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-12 11:21 FAQ and other shell syntax Stephane Chazelas
2005-01-12 12:22 ` Alexandre Duret-Lutz

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).