Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
xargs with zsh function
- X-seq: zsh-users 26388
- From: Ray Andrews <rayandrews@xxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: xargs with zsh function
- Date: Sun, 17 Jan 2021 15:12:08 -0800
- Archived-at: <https://zsh.org/users/26388>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-users/2021-01/eee04aa4-394f-9e4b-1637-538059745b5c%40eastlink.ca>
- List-id: <zsh-users.zsh.org>
Can it be done?
$ ... | xargs my_function
it seems that xargs only likes binary commands. There was some thought
on the web that something roughly like:
$ ... | xargs "zsh -c my_function"
might work but 'zsh -c' seems to be a virginal shell that doesn't know
my_function exists. How do we pipe into a function?
$ func_2 "${(f)$(func_1 *)}"
... works but there's the usual travail getting zsh to break on lines.
Mind that's always the case so perhaps that's as good as it gets. But I
figure that piping should be doable.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author