Answer the question
In order to leave comments, you need to log in
How to redirect output from process in background to variable?
I'm accessing the site using curl which is causing a CPU load. I need to log the load, but in the end I have to get a response from the site. I run curl in the background and redirect the output to a file. In the loop, I register the load and try to read the data from the file. When the data appears - everything is ok. If they do not appear for some time (according to the counter) - I also get a certain result. I want to write the output from a process in the background not to a file, but to a variable. How to do it?
Now I do
curl blabla & >$filename.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question