[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: xargs --negate-interactive
From: |
Bernhard Voelker |
Subject: |
Re: xargs --negate-interactive |
Date: |
Sun, 17 Apr 2016 22:12:08 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 |
On 04/10/2016 04:26 PM, 積丹尼 Dan Jacobson wrote:
>>>>>> "BV" == Bernhard Voelker <address@hidden> 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