
Zsh-lovers – tips, tricks and examples for the Z shell - q_revert
http://grml.org/zsh/zsh-lovers.html
======
phreeza
This list is great (and old), but what I would really like is a more concise
list of stuff zsh can do that bash can't, and that has been vetted by people
who know bash well. (like one thing that comes to mind is recursive globbing
with two astersisks, but to be honest I have no clue if maybe bash can do that
too by now).

The reason why I want such a list is I usually point people to zsh-lovers list
who ask me why I use zsh, but something more to the point would be great, and
probably more convincing.

~~~
tmhedberg
> (like one thing that comes to mind is recursive globbing with two
> astersisks, but to be honest I have no clue if maybe bash can do that too by
> now)

It can, if you set the `globstar` option:

    
    
        $ shopt -s globstar
        $ echo **/*.txt
        a/a2/baz.txt a/bar.txt a/foo.txt b/bar.txt b/foo.txt

~~~
q_revert
another nice one which i get a lot of use out've.. (again, no idea if bash can
do this too)

    
    
       $ setopt brace_ccl #put this in your ~/.zshrc
    
       $ echo {1-3}.pdf {a-d}.pdf
       1.pdf 2.pdf 3.pdf a.pdf b.pdf c.pdf d.pdf

~~~
jvehent
Bash can do that easily, the syntax is just a bit different

    
    
        $ echo {1..3}.pdf {a..d}.pdf
        1.pdf 2.pdf 3.pdf a.pdf b.pdf c.pdf d.pdf

~~~
dima55
The parent was wrong, and bash can't do the thing he MEANT. The above aren't
globs, they just generates strings. None of those files need to exist. In zsh
you can use

    
    
        <7-10>.txt
    

to match 7.txt, 8.txt, 9.txt and 10.txt. Zero-padding is loose. 07.txt and
08.txt match also, for instance. The bash {..} syntax just doesn't handle this
variable 0-padding case, which is extremely common when looking at a directory
full of photos, for instance.

------
dbbolton
I've been using zsh as my primary shell for roughly 5 years. I made an earnest
effort in the beginning to read the 400+ page User Guide[1]. Though I learned
a lot, it's simply to much information to retain-- especially the things you
don't exactly use often. For me, "quick reference" materials like this list
have become essential. I've resigned to remembering only the important stuff
that I need daily, and for the other things (say, how to write your own
completion file for a command that takes a bunch of different types of
parameters) I simply remember _where I can look it up_ (the links section of
zsh-lovers is probably the most useful simply for this reason). And when I
can't do that, #zsh on freenode has been a genuinely helpful community.

1\. <http://zsh.sourceforge.net/Guide/>

------
hnriot
It's funny to see alias PIPE='|'

That's not much of an alias. Usually I use them to shorten the typing, not
make it longer.

Here's my suggestion:

alias "list all files, but don't show much info"= ls

Premature 4/1

~~~
tomprince
I could imagine that that is for keyboard layouts where | is prohibitively
difficult to type.

