3
$\begingroup$

I need this command to work through the WolframKernel and it seems well beyond my understanding why it does not work above a certain amount of data size I'm passing to Run

show[g_]:=Run["LD_LIBRARY_PATH=/usr/bin;
   echo'<>StringReplace[ExportString[g,"SVG"],"\n"->" "]<>"'|bcat -b firefox &"]

It requires bcat (apt-get ruby-bcat) and it opens a new Firefox tab.

For simple graphics there're no issues. But, if I create a big SVG string the shell returns with error 32512. It's like the WolframKernel does not like to pass long commands to the shell. As a matter of fact, by exporting the same big SVG string+bash syntax to a shell executable, it runs just fine.

For instance, RandomGraph[{100,100}] is already too big to be evaluated by the show function.

$\endgroup$
  • $\begingroup$ A workaround might be to export to a file and then read that file into bcat. $\endgroup$ – Carl Lange Jan 12 at 1:18
  • $\begingroup$ @CarlLange that's what I meant with "As a matter of fact, by exporting the same big SVG string+bash syntax to a shell executable, it runs just fine. " $\endgroup$ – Fortsaint Jan 12 at 1:50
  • 2
    $\begingroup$ Ah, sorry, I didn't see that. ExportString[RandomGraph[{100, 100}], "SVG"] is nearly 0.1 MB in size - I don't know what the issue is but it wouldn't shock me greatly to find that there's a bottleneck somewhere. Pasting 95000 characters into a terminal might break too. $\endgroup$ – Carl Lange Jan 12 at 2:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.