Listen for input stream from bash script ...

Dear Processing community,

for a university project, I really need your help with this. Together with my colleague I created a bash script which crawls some websites and matches keywords and whatsoever. The output we get from this script (to stdout), we would like to process that in Processing.

Could anyone please tell me how to achieve this?

OR: Can/Should I run/execute the script from within Processing and then how do I get the output of the script this way?

Kindest regards and thanks in advance!

Answers

  • pipe the results into a file. read the file.

  • How would I read the file in your opinion? Thanks for the help!

  • If you pipe the results to stdout like this:

    $ YOUR_script_outpu > filenameOutFile.txt

    Then you could use loadstring function from processing to load your data. This only works if your stdout output was saved in a specific format, for example, tab or space delimited.

    Check the reference for more ingo about the function:

    https://processing.org/reference/loadStrings_.html

    I hope this helps,

    Kf

Sign In or Register to comment.