Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: SImple way to execute command on list of files?
- X-seq: zsh-workers 44224
- From: Leah Neukirchen <leah@xxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: SImple way to execute command on list of files?
- Date: Sun, 14 Apr 2019 15:50:36 +0200
- In-reply-to: <20190414084632.t4gdc2fjswogznxy__31239.9886942998$1555231731$gmane$org@gmx.de> (Dominik Vogt's message of "Sun, 14 Apr 2019 09:46:32 +0100")
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20190414084632.t4gdc2fjswogznxy__31239.9886942998$1555231731$gmane$org@gmx.de>
Dominik Vogt <dominik.vogt@xxxxxx> writes:
> Other than writing an alias or a function, is there a simple way
> to call commands that take only one file argument multiple times?
>
> In other words
>
> $ xpdf *.pdf
> $ ps2pdf a.ps b.ps c.ps
>
> should be executed (semantically) as
>
> $ for F in *.pdf; do xpdf "$F"; done
> $ ps2pdf a.ps; ps2pdf b.ps; ps2pdf c.ps
>
> I'm looking for a kind of extension for the command syntax. Of
> course I could write a function with that syntax for each command,
> but is there a more general way where you can define a list of
> commands to treat differently, say
>
> annoying_commands xpdf ps2pdf gv
autoload zargs
zargs -n1 *.pdf -- xpdf
--
Leah Neukirchen <leah@xxxxxxxx> http://leahneukirchen.org/
Messages sorted by:
Reverse Date,
Date,
Thread,
Author