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

Re: brace expansion in function



Eric Smith wrote:
> I would like a shell function that expands the arg
> {corrs,dylan,crespo}
> 
> This try only gives all corrs songs:
> 
> mpg() {
> mpg321 *$1*
> }

mpg() {
    local arg
    local l
    for arg ; do l="*$arg* $l" ; done
    eval mpg321 $l
}

Ciao,
Thomas

-- 
 Thomas Köhler       Email:       jean-luc@xxxxxxxxxxxxxxxxx
     <><             WWW:           http://jeanluc-picard.de
                     IRC:                           tkoehler
                     PGP public key available from Homepage!

Attachment: signature.asc
Description: Digital signature



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