LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] Multiple windows clients to see stdout?

[ILUG] Multiple windows clients to see stdout?

kevin lyda kevin at suberic.net
Tue Nov 28 12:04:15 GMT 2000


On Tue, Nov 28, 2000 at 09:36:04AM -0000, Mark Finnegan wrote:
> I need some way to allow multiple users on windows machines see the standard
> output from a long running application. X-windows server/client setup seems
> to be somewhat of an overkill.
> At present I'm simply redirecting output to a text file and allowing all the
> involved users read only access.
> This is (obviously enough) somewhat less than ideal. Is there any simple way
> to share stdout that I should know about?
> 
> Preferably fairly generic U*NIX as I need to recreate it under Redhat (6.2),
> Solaris 8 (x86) and SCO 5.05 (Though the SCO boxen are being retired in
> favour of solaris over the next few months so they're not as critical)

using the same file, make the following addition to /etc/inetd.conf:

12345   stream  tcp     nowait  nobody    /usr/local/sbin/fileviewer.sh fileviewer.sh /path/to/file/filename

then use this script (note that ^M means C-m, you can do this in vi by
typing C-vC-m in insert mode):

#!/bin/sh
FILE=$1
read x y
while [ "$y"x != "x" ]; do
    read x y
done
cat << EOF
HTTP/1.1 200 OK
Content-Type: text/html^M
^M
<html><head><title>File contents</title></head><body><pre>
EOF
cat $FILE
echo '</pre></body></html>'

an additional tweak might be to change from cat to using tail.  you could
even make it configurable with this:

#!/bin/sh
FILE=$1
read x y
if echo $y|grep tail; then SPEW="tail -100"; else SPEW=cat; fi
...
$SPEW $FILE

anyway once done, just connect to the un*x box via a web server like so:
http://unix.box:12345/  i don't think i used any gnu'isms so this should
work across the boxes you describe.

cheers,

kevin

-- 
kevin at suberic.net        q: what's the difference between batman & b. gates?
fork()'ed on 37058400    a: when batman fought the penguin, he won.
meatspace place: home                             http://suberic.net/~kevin/
 >> want privacy? www.gnupg.org or www.pgp.com.  encrypted mail preferred <<




More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell