While testing a Apache webserver configuration, I became tired of setting up two xterms for monitoring both the
/var/log/httpd-access and
/var/log/httpd-error.log files.
The following simple script does this now for me:
Code:
#!/bin/sh
# Set up two xterms
# 1) tail -f /var/log/httpd-access.log
# 2) tail -f /var/log/http-error.log
ACCESS='ssh j65nko.org "tail -f /var/log/httpd-access.log"'
ERROR='ssh j65nko.org "tail -f /var/log/httpd-error.log"'
# geometry (See X(7) 'GEOMETRY SPECIFICATIONS')
# WidthxHeight+X_offset+Y_offset
# Width and Height either in pixels or characters
# X_offset and Y_offset in pixels
# See xterm(1) for the other options
xterm -geometry 200x30+0+0 -bg black -fg green -e "${ACCESS}" &
xterm -geometry 200x30+0+500 -bg black -fg red -e "${ERROR}" &
Please note that according to the
xterm manual page. the
-e option for specifiying the command needs to be the last one.
This script has been tested and is being used in Debian as you can see in the trimmed screenshot.