Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Z-Shell (zsh) FAQ changes this month



This file contains general information on how to find out about zsh,
(the first part of the FAQ up to item 1.1), then any other items which
have changed since last month's posting, then the differences in the
yodl version of the FAQ.  If you would like a complete individual
copy, email me and I will add you to the list.


Archive-Name: unix-faq/shell/zsh
Last-Modified: 2001/09/24
Submitted-By: pws@xxxxxxxxxxxxxxxxxxxxxxxx (Peter Stephenson)
Posting-Frequency: Monthly
Copyright: (C) P.W. Stephenson, 1995--2001 (see end of document)

Changes since last issue posted:

  1.1  Web address of Zsh information pages changed.
  1.7  Making zsh your login shell, e-mail discussion.

This document contains a list of frequently-asked (or otherwise
significant) questions concerning the Z-shell, a command interpreter
for many UNIX systems which is freely available to anyone with FTP
access.  Zsh is among the most powerful freely available Bourne-like
shell for interactive use.

If you have never heard of `sh', `csh' or `ksh', then you are
probably better off to start by reading a general introduction to UNIX
rather than this document.

If you just want to know how to get your hands on the latest version,
skip to question 1.6; if you want to know what to do with
insoluble problems, go to 5.2.

Notation: Quotes `like this' are ordinary textual quotation
marks.  Other uses of quotation marks are input to the shell.

Contents:
Chapter 1:  Introducing zsh and how to install it
1.1. Sources of information
1.2. What is it?
1.3. What is it good at?
1.4. On what machines will it run?  (Plus important compilation notes)
1.5. What's the latest version?
1.6. Where do I get it?
1.7. I don't have root access: how do I make zsh my login shell?

Chapter 2:  How does zsh differ from...?
2.1. sh and ksh?
2.2. csh?
2.3. Why do my csh aliases not work?  (Plus other alias pitfalls.)
2.4. tcsh?
2.5. bash?
2.6. Shouldn't zsh be more/less like ksh/(t)csh?

Chapter 3:  How to get various things to work
3.1. Why does `$var' where `var="foo bar"' not do what I expect?
3.2. In which startup file do I put...?
3.3. What is the difference between `export' and the ALL_EXPORT option?
3.4. How do I turn off spelling correction/globbing for a single command?
3.5. How do I get the meta key to work on my xterm?
3.6. How do I automatically display the directory in my xterm title bar?
3.7. How do I make the completion list use eight bit characters?
3.8. Why do the cursor (arrow) keys not work?
3.9. Why does my terminal act funny in some way?
3.10. Why does zsh not work in an Emacs shell mode any more?
3.11. Why do my autoloaded functions not autoload [the first time]?
3.12. How does base arithmetic work?
3.13. How do I get a newline in my prompt?
3.14. Why does `bindkey ^a command-name' or 'stty intr ^-' do something funny?
3.15. Why can't I bind \C-s and \C-q any more?
3.16. How do I execute command `foo' within function `foo'?
3.17. Why do history substitutions with single bangs do something funny?
3.18. Why does zsh kill off all my background jobs when I logout?
3.19. How do I list all my history entries?
3.20. How does the alternative loop syntax, e.g. `while {...} {...}' work?
3.21. Why is my history not being saved?
3.22. How do I get a variable's value to be evaluated as another variable?
3.23. How do I prevent the prompt overwriting output when there is no newline?
3.24. What's wrong with cut and paste on my xterm?
3.25. How do I get coloured prompts on my colour xterm?
3.26. Why is my output duplicated with `foo 2>&1 >foo.out | bar'?

Chapter 4:  The mysteries of completion
4.1. What is completion?
4.2. What sorts of things can be completed?
4.3. How does zsh deal with ambiguous completions?
4.4. How do I complete in the middle of words / just what's before the cursor?
4.5. How do I get started with programmable completion?
4.6. And if programmable completion isn't good enough?

Chapter 5:  The future of zsh
5.1. What bugs are currently known and unfixed? (Plus recent important changes)
5.2. Where do I report bugs, get more info / who's working on zsh?
5.3. What's on the wish-list?
5.4. Did zsh have problems in the year 2000?

Acknowledgments

Copyright
--- End of Contents ---

Chapter 1: Introducing zsh and how to install it

1.1: Sources of information

  Information on zsh is available via the World Wide Web.  The URL
  is http://zsh.sunsite.dk/ .
  The server provides this FAQ and much else and is
  now maintained by Karsten Thygesen and others (mail zsh@xxxxxxxxxx
  with any related messages).  The FAQ is at http://zsh.sunsite.dk/FAQ/ .
  The site also contains some contributed zsh scripts and functions;
  we are delighted to add more, or simply links to your own collection.

  This document was originally written in YODL, allowing it to be converted
  easily into various other formats.  The master source file lives at
  http://zsh.sunsite.dk/FAQ/zshfaq.yo and the plain text version
  can be found at http://zsh.sunsite.dk/FAQ/zshfaq.txt .

  Another useful source of information is the collection of FAQ articles
  posted frequently to the Usenet news groups comp.unix.questions,
  comp.unix.shells and comp.answers with answers to general questions
  about UNIX.  The fifth of the seven articles deals with shells,
  including zsh, with a brief description of differences.  There is
  also a separate FAQ on shell differences and how to change your
  shell.  Usenet FAQs are available via FTP from rtfm.mit.edu and
  mirrors and also on the World Wide Web; see

    USA         http://www.cis.ohio-state.edu/hypertext/faq/usenet/top.html
    UK          http://www.lib.ox.ac.uk/internet/news/faq/comp.unix.shell.html
    Netherlands http://www.cs.uu.nl/wais/html/na-dir/unix-faq/shell/.html

  You can also get it via email by emailing mail-server@xxxxxxxxxxxx
  with, in the body of the message, `send faqs/unix-faq/shell/zsh'.

  The latest version of this FAQ is also available directly from any
  of the zsh archive sites listed in question 1.6.

  I have been putting together a user guide to complement the manual by
  explaining the most useful features of zsh in a more easy to read way.
  This is now more than half complete and includes a discussion of
  the new form for command line completion, not described in the FAQ.
  You can find it in various formats at:
    http://zsh.sunsite.dk/Guide/

  (As a method of reading the following in Emacs, you can type \M-2
  \C-x $ to make all the indented text vanish, then \M-0 \C-x $
  when you are on the title you want.)

  For any more eclectic information, you should contact the mailing
  list:  see question 5.2.

--- End of general information, changed items follow in full ---

Minor changes of phrasing, spelling, etc. are not included.

1.7: I don't have root access: how do I make zsh my login shell?

  Unfortunately, on many machines you can't use `chsh' to change your
  shell unless the name of the shell is contained in /etc/shells, so if
  you have your own copy of zsh you need some sleight-of-hand to use it
  when you log on.  (Simply typing `zsh' is not really a solution since
  you still have your original login shell waiting for when you exit.)

  The basic idea is to use `exec <zsh-path>' to replace the current
  shell with zsh.  Often you can do this in a login file such as .profile 
  (if your shell is sh or ksh) or .login (if it's csh).  Make sure you
  have some way of altering the file (e.g. via FTP) before you try this as
  `exec' is often rather unforgiving. 

  If you have zsh in a subdirectory `bin' of your home directory,
  put this in .profile:

    [ -f $HOME/bin/zsh ] && exec $HOME/bin/zsh -l

  or if your login shell is csh or tcsh, put this in .login:

    if ( -f ~/bin/zsh ) exec ~/bin/zsh -l

  (in each case the `-l' tells zsh it is a login shell).

  If you want to check this works before committing yourself to it,
  you can make the login shell ask whether to exec zsh.  The following
  work for Bourne-like shells:

    [ -f $HOME/bin/zsh ] && {
            echo "Type Y to run zsh: \c"
            read line
            [ "$line" = Y ] && exec $HOME/bin/zsh -l
    }

  and for C-shell-like shells:

    if ( -f ~/bin/zsh ) then
            echo -n "Type Y to run zsh: "
            if ( "$<" == Y ) exec ~/bin/zsh -l
    endif

  It's not a good idea to put this (even without the -l) into .cshrc,
  at least without some tests on what the csh is supposed to be doing,
  as that will cause _every_ instance of csh to turn into a zsh and
  will cause csh scripts (yes, unfortunately some people write these)
  which do not call `csh -f' to fail.  If you want to tell xterm to
  run zsh, change the SHELL environment variable to the full path of
  zsh at the same time as you exec zsh (in fact, this is sensible for
  consistency even if you aren't using xterm).  If you have to exec
  zsh from your .cshrc, a minimum safety check is `if ($?prompt) exec
  zsh'.

  If you like your login shell to appear in the process list as `-zsh',
  you can link `zsh' to `-zsh' (e.g. by `ln -s ~/bin/zsh 
  ~/bin/-zsh') and change the exec to `exec -zsh'.  (Make sure
  `-zsh' is in your path.) This has the same effect as the `-l'
  option. 

  There was a thread on this topic on the zsh-workers mailing list,
  starting from item 15747.  You can find this at http://www.zsh.org/mla/.

  Footnote: if you DO have root access, make sure zsh goes in
  /etc/shells on all appropriate machines, including NIS clients, or you
  may have problems with FTP to that machine.


--- End of changed items, diff from previous version follows ---
Index: zshfaq.yo
===================================================================
RCS file: /pack/anoncvs/zsh/www/FAQ/zshfaq.yo,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -r1.68 -r1.69
--- zshfaq.yo	2001/08/27 17:58:18	1.68
+++ zshfaq.yo	2001/09/24 20:34:23	1.69
@@ -43,11 +43,11 @@
 whenman(report(ARG1)(ARG2)(ARG3))\
 whenms(report(ARG1)(ARG2)(ARG3))\
 whensgml(report(ARG1)(ARG2)(ARG3)))
-myreport(Z-Shell Frequently-Asked Questions)(Peter Stephenson)(2001/08/27)
+myreport(Z-Shell Frequently-Asked Questions)(Peter Stephenson)(2001/09/24)
 COMMENT(-- the following are for Usenet and must appear first)\
 description(\
 mydit(Archive-Name:) unix-faq/shell/zsh
-mydit(Last-Modified:) 2001/08/27
+mydit(Last-Modified:) 2001/09/24
 mydit(Submitted-By:) email(pws@xxxxxxxxxxxxxxxxxxxxxxxx (Peter Stephenson))
 mydit(Posting-Frequency:) Monthly
 mydit(Copyright:) (C) P.W. Stephenson, 1995--2001 (see end of document)
@@ -55,7 +55,8 @@
 
 bf(Changes since last issue posted:)
 description(
-  mydit()     No changes (it's August).
+  mydit(1.1)  Web address of Zsh information pages changed.
+  mydit(1.7)  Making zsh your login shell, e-mail discussion.
 )
 
 This document contains a list of frequently-asked (or otherwise
@@ -148,21 +149,21 @@
 label(11)
 
   Information on zsh is available via the World Wide Web.  The URL
-  is url(http://sunsite.dk/zsh/)(http://sunsite.dk/zsh/) .
+  is url(http://zsh.sunsite.dk/)(http://zsh.sunsite.dk/) .
   The server provides this FAQ and much else and is
   now maintained by Karsten Thygesen and others (mail \
   email(zsh@xxxxxxxxxx)
   with any related messages).  The FAQ is at \
-url(http://sunsite.dk/zsh/FAQ/)(http://sunsite.dk/zsh/FAQ/) .
+url(http://zsh.sunsite.dk/FAQ/)(http://zsh.sunsite.dk/FAQ/) .
   The site also contains some contributed zsh scripts and functions;
   we are delighted to add more, or simply links to your own collection.
 
   This document was originally written in YODL, allowing it to be converted
   easily into various other formats.  The master source file lives at
-  url(http://sunsite.dk/zsh/FAQ/zshfaq.yo)
-(http://sunsite.dk/zsh/FAQ/zshfaq.yo) and the plain text version
-  can be found at url(http://sunsite.dk/zsh/FAQ/zshfaq.txt)
-(http://sunsite.dk/zsh/FAQ/zshfaq.txt) .
+  url(http://zsh.sunsite.dk/FAQ/zshfaq.yo)
+(http://zsh.sunsite.dk/FAQ/zshfaq.yo) and the plain text version
+  can be found at url(http://zsh.sunsite.dk/FAQ/zshfaq.txt)
+(http://zsh.sunsite.dk/FAQ/zshfaq.txt) .
 
   Another useful source of information is the collection of FAQ articles
   posted frequently to the Usenet news groups comp.unix.questions,
@@ -190,13 +191,10 @@
 
   I have been putting together a user guide to complement the manual by
   explaining the most useful features of zsh in a more easy to read way.
-  This will be a long project, but a partial version describing how to
-  write startup files and how to use the new, more powerful, form for
-  completion which first appeared in 3.1.6 (and is not described in this
-  FAQ) can be seen by looking at
-    url(http://www.pwstephenson.fsnet.co.uk/computing/)
-(http://www.pwstephenson.fsnet.co.uk/computing/)
-  where it exists in various formats.
+  This is now more than half complete and includes a discussion of
+  the new form for command line completion, not described in the FAQ.
+  You can find it in various formats at:
+    url(http://zsh.sunsite.dk/Guide/)(http://zsh.sunsite.dk/Guide/)
 
   (As a method of reading the following in Emacs, you can type tt(\M-2
   \C-x $) to make all the indented text vanish, then tt(\M-0 \C-x $)
@@ -434,8 +432,8 @@
   link(1.1)(11)) at:
 
   description(
-    mydit()        url(http://sunsite.dk/zsh/Patches/)
-(http://sunsite.dk/zsh/Patches/)
+    mydit()        url(http://zsh.sunsite.dk/Patches/)
+(http://zsh.sunsite.dk/Patches/)
   )
      
 sect(I don't have root access: how do I make zsh my login shell?)
@@ -498,6 +496,10 @@
   mytt(-zsh) is in your path.) This has the same effect as the mytt(-l)
   option. 
 
+  There was a thread on this topic on the zsh-workers mailing list,
+  starting from item 15747.  You can find this at url(http://www.zsh.org/mla/)\
+(http://www.zsh.org/mla/).
+
   Footnote: if you DO have root access, make sure zsh goes in
   /etc/shells on all appropriate machines, including NIS clients, or you
   may have problems with FTP to that machine.
@@ -2351,4 +2353,4 @@
 however, that this document changes monthly and it may be more useful
 to provide a pointer to it rather than the entire text.  A suitable
 pointer is "information on the Z-shell can be obtained on the World
-Wide Web at URL http://sunsite.dk/zsh/";.
+Wide Web at URL http://zsh.sunsite.dk/";.



Messages sorted by: Reverse Date, Date, Thread, Author