Skip to Content.
Sympa Menu

sm-discuss - Re: [SM-Discuss] Using xargs

sm-discuss AT lists.ibiblio.org

Subject: Public SourceMage Discussion List

List archive

Chronological Thread  
  • From: Paul <dufflebunk AT dufflebunk.homeip.net>
  • To: sm-discuss <sm-discuss AT lists.ibiblio.org>
  • Subject: Re: [SM-Discuss] Using xargs
  • Date: Wed, 14 Apr 2004 18:56:49 -0400

It's only necessary when you have the possibility of a lot of
parameters. My guess is 32k. Should you desire to know the exact number,
here's a one liner for you:
( f() { [[ $1 -eq $# ]] && echo "$1==$#"; } ; let i=2; arg="1"; while :
; do arg="$i ${arg}"; f $arg || break; let i++; done )
That should stop when the number of args is wrong. We may use xargs in a
place or two now, where it makes things easier to understand.

On Wed, 2004-04-14 at 17:42, Eric Sandall wrote:
> I just saw a brief article[0] on linux.com about xargs and am wondering if
> that
> might help our Sorcery team (though from what I remember at least some of
> them
> already know about it ;)).
>
> [0] http://www.linux.com/article.pl?sid=04/04/13/211209
--
De mortuis nihil nisi bonum.

Attachment: signature.asc
Description: This is a digitally signed message part




Archive powered by MHonArc 2.6.24.

Top of Page