I think the "an exact problem" thing tends to be misleading for open ended issues like this.
The while loop works (and I have used it), but can be tremendously slow, depending on the command in question (and if you need xargs to break up the command line, there tends to be a lot of work that needs doing). And, generally speaking, this is solvable - but it's also a problem that should have been solved once and for all a long time ago. (And, by "solved" I mean that it should be straightforward to use the xargs with the unix "standard" where one line is one record - here, a record being a file name.) Anyways, the -d option looks like it might be as good as it can get? Thanks, -- Raul On Fri, Oct 13, 2017 at 9:26 PM, Andre Smagin <a...@smagin.com> wrote: > On Fri, 13 Oct 2017 18:03:59 -0400 > Raul Miller <rauldmil...@gmail.com> wrote: > >> "Because then you don't need xargs, normal tooling seperates each line >> into a seperate argv entry regardless of other spacing." >> >> If there's some existing way (portable or not) to build this kind of >> argv in a shell script - using newline separation and nothing else - I >> would really appreciate another hint. > > I wish you would have given an exact problem you are having > difficulties with... > > I've been using > > ls | while read i; do echo "$i"; done > or > cat /tmp/tmp_file | while read i; do echo "$i"; done > > type of constructs for years and have never even needed xargs... > > -- > Andre >