Skip to content
Simple bash script to create a graph of a changing value using screen and gnuplot.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Gerhard Siegesmund <>

This is a simple bash script to use `screen` and `gnuplot`, to output a simple
graph of one changing number output to a screen window.

This script is written for bash and uses quite a lot of common tools. Namely:

* bash
* gnuplot
* sed
* perl
* gnu screen

This script is not very elegant, mostly from being hacked together in about 2
hours. I just wanted to visualize the output of another script which was output
to a screen-window.  It works. Nevertheless YMMV!


You need at least one `screen` running. Check for the `$STY`, as you need this
for screen-graph to find the data. So inside `screen` do:

    $ echo $STY

Then create a new window in `screen` and give it a title. Using
standard-shortcuts that would be `CTRL-a c` to create the new window followed
by `ctrl-a :title WINDOWNAME<RETURN>` to set the title `WINDOWNAME` for that

Now this will be the data-window. Just run a script inside this window which
just outputs the data to visualize in the following form:

    UNIX-TIMESTAMP yourValue

For example the following line outputs the load in the given form:

    $ while true; do echo -n $(date +%s)' '; cat /proc/loadavg | cut -f 1 -d ' '; sleep 10; done

The output will look something like this:

    1144870745 0.22
    1144870755 0.18
    1144870765 0.39
    1144870775 0.64
    1144870785 0.85

Now comes the magic. In another window, or even on another terminal (on the
same computer as the same user though!) enter (considering `` is
in your PATH!)


Use the parameters entered above! The result should be a graph filling up your
terminal-window. If it doesn't work, well, use the source, luke. :)

If you have ideas on improving this script, or have found any bugs, please tell
me via email <>.

This script is published under the GPL.
You can’t perform that action at this time.