nushell.github.io icon indicating copy to clipboard operation
nushell.github.io copied to clipboard

Documention example for migrating from xargs

Open srgfrog opened this issue 2 years ago • 1 comments

Is it possible to include this example to book/coming_from_bash.html, to demonstrates how to migrate xargs?

ls -Q ~/Downloads/*.mp4 |  xargs  mpv --shuffle --vid=no

(ls ~/Downloads/*.mp4).name   | run-external  "mpv" "--shuffle" "--vid=no" $in

srgfrog avatar Sep 01 '23 00:09 srgfrog

Feel free to open a PR along those lines. I would recommend that the example only uses well known programs so you don't need to look for the example or install it to try.

sholderbach avatar Sep 01 '23 11:09 sholderbach

This use-case is covered using xargs vim in the doc, and the syntax has been updated to include the list spreader operator.

Bash Nushell
find . -name Makefile | xargs vim ls **/Makefile | get name | vim ...$in

I think we can close this one as completed.

NotTheDr01ds avatar Aug 09 '24 10:08 NotTheDr01ds