Skip to content
Advertisement

Can’t solve this error when monitoring a output using sh

I’m working on an optimization and for that I need to link a matlab code into a linux program and keep monitoring the outputs. I’d done this link using this sh below, however it wasn’t working well, since I couldn’t keep track of more than one ‘expression’.

JavaScript

I’ve asked for help here, and I got a good solution. The solution solved partially the problem. Running the program on the prompt it was possible to keep track on those expressions and kill the program when needed. The solution given was:

JavaScript

When I implemented on the matlab, and did the ‘linkage’ the code didn’t responded well. After a few minutes running, the matlab got stuck, I couldn’t get any answer from the terminal. When looked manually on the outputs of my program I realized that there were no problems on the program, and the outputs was normally being written.

I can’t solve this problem. I don’t have a lot of experience on sh. I’ve searched for answers, but I couldn’t find any. Alternative suggestions to achieve the same thing are also welcome.

Thanks in advance

Advertisement

Answer

The tail -f is causing the hang. You need to also kill the sed/tail process in order to continue.

JavaScript

ref: https://stackoverflow.com/a/2041505/1563960

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement