Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.graphics.apps.gnuplot > #4034

Re: find piped to xargs gnuplot -c crashes

From Ethan Merritt <eamerritt@gmail.com>
Newsgroups comp.graphics.apps.gnuplot
Subject Re: find piped to xargs gnuplot -c crashes
Date 2018-09-05 16:05 +0000
Organization A noiseless patient Spider
Message-ID <pmousc$a35$1@dont-email.me> (permalink)
References <5b8fd661$0$32244$e4fe514c@news.xs4all.nl>

Show all headers | View raw


On Wed, 05 Sep 2018 13:13:06 +0000, Alex van der Spek wrote:

> I am trying to execute a gnuplot script on a large number of files found 
> by find like so:
> 
> find . -name ??0rpm0?0rms.csv.bz2 | xargs gnuplot -c "xyz2plt.gp"
> 
> This crashes on a signal 11.

I do not know enough about xargs to explain exactly what is happening
in this case.  Let us suppose that the "find" command emits a sequence
of filenames X1 X2 X3 X4 ....   My understanding from the xargs man 
page is the it will construct a command sequence
            gnuplot -c "xyz2plt.gp" X1 X2 X3 ... XN  
            gnuplot -c "xyz2plt.gp" XN+1 XN+2 XN+3 ... X2N
            ...
where N is the number of filenames that fit in the command buffer
without overflowing.


> 
> The gnuplot script "xyz2plt.gp" contains only one line:
> 
> print sprintf("%s %i %s", ARG0, ARGC, ARG1)
> 
> Using a call instead of the -c option like so:
> 
> find . -name ??0rpm0?0rms.csv.bz2 | xargs gnuplot -e 'call "xyz2plt.gp"'
> 
> does not crash and gives the following output returned in the terminal:
> 
> xyz2plt.gp 0 
> 
> BZh91AY&SY��!���ۀ@
>               ^
> "./24aug2018/400rpm050rms.csv.bz2", line 1: invalid character 
> 
> Why does ARGC hold a 0, xargs adds the names of the files to the 
> commandline does it not?

In this case ARGC holds a 0 because the command being executed is
    call "xyz2plt.gp"
with no further arguments.  Gnuplot will execute that command first
before going back to the shell input to see if there are any more
arguments.  

	Ethan



> Any help much appreciated.
> Alex van der Spek

Back to comp.graphics.apps.gnuplot | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

find piped to xargs gnuplot -c crashes Alex van der Spek <amvds@xs4all.nl> - 2018-09-05 13:13 +0000
  Re: find piped to xargs gnuplot -c crashes Ethan Merritt <eamerritt@gmail.com> - 2018-09-05 16:05 +0000
    Re: find piped to xargs gnuplot -c crashes Alex van der Spek <amvds@xs4all.nl> - 2018-09-05 17:15 +0000
      Re: find piped to xargs gnuplot -c crashes Alex van der Spek <amvds@xs4all.nl> - 2018-09-05 18:17 +0000

csiph-web