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

xargs with zsh function



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