Retrieving Output From A Command Streaming Information
That title is strained... difficult to describe my interest, even more so to do it in a pithy manner.
basically I am running a command called aseqdump. From the man page:
NAME
aseqdump - show the events received at an ALSA sequencer port
SYNOPSIS
aseqdump [-p client:port,...]
When running the program listens to a client and outputs the clients status.
In my usage I am listening to a midi device.
The output constantly refreshes.
I am trying to write a bash script that reads in the most recent line and works off the information from that last line.
How can I do this?
I have tried to set the output as a variable, but was having difficulty making this work the way I intended.
Then I piped the output to a file and read from the file, which worked fine but the file quickly filled up, so I tried to cat only the last ten lines of the file back into itself but this crashed the pipe.
In the end I wrote a separate script that determines the number of lines in the output file, if it exceeds an upper limit it kills the process, cats the last ten lines into itself, then restarts the command with an appending pipe. Then it waits and does it again when needed.
This final method is just chewing up resources. About 8% when running and 17% and 14% when idling.
All I want is to read the latest output from a running command.
How can I do what I want to do without sucking up so much CPU?Three graphics with tables of data
I need to create a figure like the following. If I have the color plots saved as png images (ie. test.png, rans.png and ddes.png), what would be the best way to create this sort of graphic in LaTeX?
That title is strained... difficult to describe my interest, even more so to do it in a pithy manner.
basically I am running a command called aseqdump. From the man page:
NAME
aseqdump - show the events received at an ALSA sequencer port
SYNOPSIS
aseqdump [-p client:port,...]
When running the program listens to a client and outputs the clients status.
In my usage I am listening to a midi device.
The output constantly refreshes.
I am trying to write a bash script that reads in the most recent line and works off the information from that last line.
How can I do this?
I have tried to set the output as a variable, but was having difficulty making this work the way I intended.
Then I piped the output to a file and read from the file, which worked fine but the file quickly filled up, so I tried to cat only the last ten lines of the file back into itself but this crashed the pipe.
In the end I wrote a separate script that determines the number of lines in the output file, if it exceeds an upper limit it kills the process, cats the last ten lines into itself, then restarts the command with an appending pipe. Then it waits and does it again when needed.
This final method is just chewing up resources. About 8% when running and 17% and 14% when idling.
All I want is to read the latest output from a running command.
How can I do what I want to do without sucking up so much CPU?Three graphics with tables of data
I need to create a figure like the following. If I have the color plots saved as png images (ie. test.png, rans.png and ddes.png), what would be the best way to create this sort of graphic in LaTeX?
No comments:
Post a Comment