0

Okay, so, I just have a quick question regarding python and linux.

I have a program that collects and outputs data to stdout indefinitely. I need to parse this data, and I have a python program I wrote that will do just that. However, I cannot save this data to a file first, as it produces far too much output to save to disk. Is there any way to use redirects to somehow pipe this output into the program?

Example:

python parser.py < ./dataCollector.sh

1 Answer 1

2

Close, but you want an actual pipe not a shell redirect:

./dataCollector.sh | python parser.py
Sign up to request clarification or add additional context in comments.

2 Comments

Yep! That worked, mostly. I figured it would be that actual pipe, but I always forget that the input program goes first. However, my script basically sets up another program, and that program's output is what I need. It seems when I parse this input, it is just the logging info from the script.
Oops. It did actually work, I was just breaking my loop on a newline... facepalm Thanks for the help!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.