On 04/10/2016 04:26 PM, 積丹尼 Dan Jacobson wrote:
>>>>>> "BV" == Bernhard Voelker <[email protected]> writes:
> BV> Well, there are many possibilities, but there is already a way to
> BV> to do it in xargs. So what would you want to achieve by saving a RET?
> BV> I don't think it's about the wearing of the ENTER key on your keyboard?
>
> Thank you. If there is a way to do
> $ seq 99|sed s/^/URL_/|xargs -pn 9 $BROWSER
> so I can browse 9 items at a time
> with just hitting RET instead of y RET, please tell me.
I'd personally go with some shell loop like:
seq 99|sed s/^/URL_/|xargs -n9 \
| while read urls; do \
read -p "$urls:" </dev/tty; \
$BROWSER $urls; \
done
Of course, as the URLs may contain some special characters, you'd have
to care about proper quoting or escaping/unescaping additionally.
Nevertheless, xargs isn't primarily a tool to get and evaluate
the user's approval to execute arbitrary tools; and I don't think
it should support more ways of evaluating such approval.
Have a nice day,
Berny