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: Vladimír Marek <vlmarek AT volny.cz>
  • To: sm-discuss <sm-discuss AT lists.ibiblio.org>
  • Subject: Re: [SM-Discuss] Using xargs
  • Date: Sun, 18 Apr 2004 10:27:03 +0200

> 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 )

Ok, I don't believe most of things I don't try myslef. I had to change
'while :' into 'while [ 1 ]' and then run the script.

After about 71 hours (Duron@1300) I'm at number 206521, and I am going
to leave this experiment :) I tried to make similar test with
exponentially growing number of parameters and 2097152 were passed fine
(my system started to swap quite a lot then).

After then I started to think (late as usual :)) and found that we were
testing nonsense. We were measuring number of parameters which can be
passed to function, which is limited only by memory. Number of
parameters which can be passed to another program is limited, and is
smaller than 32768.

Have a nice day

--
Neuron




Archive powered by MHonArc 2.6.24.

Top of Page