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

Re: (backward-)kill-argument



[  date  ] 2002/03/13 | Wednesday | 05:42 PM
[ author ] Michal Maru?ka <mmc@xxxxxxxxxxxxxxxxxx> 

Finally, something I can answer.  ;-)

> i want to:
>   * kill filenames w/  spaces: e.g.    this\ is\ file.txt

    rm *[\ ]*

    This uses a character class with a space in it '[\ ]'
    surrounded by whatever '*' which zsh understands as
    any file with a space in its name.
 
>   * maybe even the bracketed part:
>         find  { -name '*.h' }

    print **/*.h
 
    This uses the '**/' to tell zsh to glob recursively,
    and the '*.h' says to look for '*.h' while it's at it.
    If you study zsh's globbing, you'll find that it can
    do a lot of the same things the find(1) program can
    do.  
    
    To learn about some of zsh's find-like abilities,
    $(man zshexpn) and search for "Glob Qualifiers".
    Glob qualifiers allow you to put an expression in
    parentheses after a glob pattern to make the glob
    more specific.

    For example:

        find . -type d      # find directories only

    can be expressed in zsh as:

        print -l **/*(/)    # (/) means directories only

    I only suggest starting with glob qualifiers, because
    I found it the most interesting (and least intimidating)
    place to start.  To get the whole picture, $(man zshexpn)
    and search for the "FILENAME EXPANSION" section.


-- 
package wuv'apqvjgt;($_=join('',(*PgtnHcemgt))) # print map "beppu\@$_\n", qw(
=~ s/([HaP])(?!e)/ \U>$1/g;s/^.|:| (?=A)|>//g;y # cpan.org  lbox.org  binq.org
/c-z/a-u/;print"J$_\n";#$^%$^X@.^ <!-- japh --> # oss.lineo.com codepoet.org);



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