POV-Ray : Newsgroups : povray.off-topic : gathering infos from web pages : Re: gathering infos from web pages Server Time
11 Oct 2024 11:12:59 EDT (-0400)
  Re: gathering infos from web pages  
From: Warp
Date: 26 Nov 2007 19:36:09
Message: <474b6678@news.povray.org>
Ross <rli### [at] speakeasynet> wrote:
> I've never used zsh. What handy features does it have that I'm missing out
> on?

  You name it...

  I think it's quite descriptive that bash's man page is 4889 lines long
while zsh's is 20639 lines long. (It's so long, actually, that it has
been split into 16 different manpages by feature category, although you
can get the entire thing as one long manpage with 'man zshall'.)

  I must admit that I have not used bash so much as to be 100% sure that
many of the handy features I like about zsh cannot be found or turned on
(or installed as addons) in bash, but at least with the default bash
settings it seems to lack them.

  But to mention just one of the many, many handy features, zsh's
autocompletion is simply superb. It can very intelligently deduce
what you want to do from the context.
  For example, assume that in the current directory there's a bunch
of files, all of them with "-rw-r--r--" permissions except for one,
which has "-rw-------" permissions. To give it the same persmissions
as the other it's enough to write:

chmod og+r <tab>

  It will autocomplete to the only file for which the command would have
an effect. (In other words, it's not simply a dumb file completion feature.
It actually looks at what you are trying to execute, interprets it and
completes according to that. Since "chmod og+r" would be a no-op for all
the other files except one, it completes to the file for which it's not
a no-op.)
  Another of the many handy autocompletion features is that it knows the
command-line parameters of many programs. For example, you can write:

mplayer -q<tab>

and it will autocomplete that to:

mplayer -quiet

  It also completes filenames according to which program you are executing.
For example, if there are two files in the current directory, one named
"test.txt" and another named "test.avi" and you write:

mplayer t<tab>

it will autocomplete to

mplayer test.avi

  It knows that mplayer doesn't support txt files so it skips it. (Bash
does have this kind of feature too, but seems to be more limited that zsh's.
For instance, it doesn't seem to support mplayer.)

  There are many other handy autocompletion features as well.

-- 
                                                          - Warp


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.