ZSH is a fantastic shell, both for programming and day-to-day use. Much like a small business with a great product but not enough capital to market it, ZSH doesn't really have the same amount of users as bash, simple because everyone is constantly shouting out how good bash is.

Some of the things ZSH can do:

Tab completion, but more advanced than bash. It ships with completion for Portage, including emerge. Some other examples - say you type killall<tab>, it will come up with a list of process names to kill. If you type modprobe <tab>, it will come up with a list of available module names for your current kernel. If you type ls -<tab>, it ill come up with a list of options for ls. There are literally hundreds (maybe more?) commands with tab completion in zsh.

Lots of builtin functions. ZSH has built in functions such as preexec() and chpwd(). If you're wondering why the hell that's of any use, I'll give you an example. I wrote a function for my zshrc that renames the terminal title or the screen window title depending on what was last run. After that is finished, it sets the title to user@host:/workdir. Have a look.

Mail checking. Although bash has a little-known environment variable to control this, it can only handle Unix-style spool mbox's. If you compile ZSH with the maildir USE flag, it can handle maildirs/MHs too.

Right sided prompt. Using the RPROMPT environment variable, you can have a prompt on the right hand side too.

MIME. Use the mailcap/mime.types files, ZSH knows what to load when you enter a path leading to a file of such and such MIME type. If I set up everything ending in ogg to be run by ogg123, every time a enter a path to an ogg file, it will play it.

Maturity. ZSH has been going since 1990, and is still actively developed.

ZSH is not difficult to learn. In fact, in nearly all basic cases, it is syntactically the same as bash. Although ZSH is more closely related to KSH, you can barely notice the difference with bash until you start moving on to more advanced scripting, at which point ZSH's refined syntax really comes into its own. For tcsh and csh weirdos, there are options to make the shell immitate these.

I know that at least three Gentoo developers use ZSH - spider, rac and usata. I'm sure there are more.

Spider put up his zshrc around which most of mine is based on, however, I have added many things to mine. That lives here. Mine is up here. It might be slightly out of date and missing the MIME stuff I just found out about as I can't get weex to compile on amd64 and I'm too tired/drunk to upload by hand.

Three things i love in zsh :
- The incredible completion system. Colors on files like when u do a ls, the menu system when u press 2 times tab (move the cursor with arrows), and the mime type cheking.
- The advanced globbing. For example u can use **/* to generate all filenames going recursively in directories. If u want only the directories, just do **/*(/), etc... for example u want to set permissions in all subdirectories :
do a chmod 755 **/*(/); chmod 644 **/*(.).
You could do that with a find . -type d -print0 | xargs -0 chmod 755 but it's less practical.
- The zmv builtin. It is an advanced mv. If u want to save all you files in another directory you just have to do zmv -W *.bak backup/*.

The man pages are well written but rather long (they are divided into several, but the total number of lines is around 45,000). They are more useful if you know what you're looking for. You might want to try here, here and this is very useful too._________________Gentoo/AMD64, shell-tools, net-mail, vim, recruiters
IRC: slarti @ irc.freenode.net
Devspace

Nope, I'm afraid you have to make your own. If you would like to see some of the things I mentioned download you can try[ur=]http://edgeoftheinterweb.org.uk/files/dot.zshrc]mine[/url]._________________Gentoo/AMD64, shell-tools, net-mail, vim, recruiters
IRC: slarti @ irc.freenode.net
Devspace

Last edited by slarti` on Sun Jun 20, 2004 12:44 pm; edited 2 times in total

zsh completion feature is totally awesome, heck completing hostname, username with ssh m<tab>@7<tab>. Not to mention programmable completion. And what's with the ** wildcards ? find used to be one of the CLI utlility that I used quite often. Now with zsh **, find is on vacation. Heck, I am still reading the manual for zsh once in a while to see what I am missing, and it seems like I still miss quite alot._________________Three minutes of thought would suffice to find this out. But then, thought is irksome, and three minutes is a rather long time.
-- A.E. Houseman

You mentioned the emerge/modprobe tab completion was built in, however I can't get it to work.

I merged zsh, and then ran zsh. When I did my PS1 was all messed up, but I guess that its just not compatible with zsh. However when I do modprobe <tab>, all it does is list the dir in my folder. It also does the same thing for emerge. Is there an option that needs to be turned on, or am I not running it properly?

Well, you need to autoload -U compinit, and then call compinit. Look at spider's .zshrc at http://dev.gentoo.org/~spider/zshrc for more info_________________Three minutes of thought would suffice to find this out. But then, thought is irksome, and three minutes is a rather long time.
-- A.E. Houseman

I had tried it a few years back. I looked at csh and it's variants and sh and all it's variants. I figured csh is not my cup of tea. And in bourne shell category, zsh was the ruler, but, before you get urself too invested into a shell and all it's features, i thought, i gotta consider if i am going to have in all the *nix system I am going to touch, because more often than not, shell will be my window to the machine. Clearly sh will be there, but it's too primitive. So, I decided on bash and haven't looked back ever since.

P.S. and yes, ksh is a good one if any system doesn't have bash. I was using it for some time. it's no way related to kde, if you are wondering

One of the things you can do (not sure if it works in your cases, I forget (but 90% sure it'll fix it) ) is type

Code:

prompt -p |less

to preview all possible preset fonts. then to chage the prompt

Code:

prompt <prompt-name> <prompt-colors>

for instance, mine is

Code:

prompt elite2 blue red

and it looks like :

(ryan@demosthenes)(230/pts)(09:11pm:06/21/04)-
(%:~)-

I love zsh. I haven't gotten into the scripting stuff much, but I love the completions. One problem I have is whenever I hit delete, home, end, or anything in that area it capitalizes the letters and screws up the command.

You might want to read the manual page for zle, if that's the case. I really don't use the home and end keys much anyway, since I am used to C-e and C-a anyway._________________Three minutes of thought would suffice to find this out. But then, thought is irksome, and three minutes is a rather long time.
-- A.E. Houseman