SUMMARY: Progam that doesn't accept STDIN pipes

From: Eric Voisard (evoisard@atisuher.ch)
Date: Fri Dec 19 2003 - 05:18:01 EST


Hi,

Given the number of replies I got, I should feel somewhat ignorant not to
know 'expect'!
Thanks to the many people who gave me suggestions.

My problem is a program which is normally used interactively, but which
fails on STDIN input pipes. Such a command doesn't work: 'echo my_string |
/path/prog', nor does '/path/prog < file'.

What I've noticed with 'truss /path/prog' is that my program does indeed use
STDIN (no tty as I supposed), and makes some read(0,*buf, size) on it. I
guess it is doing things on its own on SDTIN and doesn't expect some EOF.

As most people suggested, running my prog through the tcl tool "Expect"
http://expect.nist.gov/ could do the trick. There is a Solaris precompiled
version at http://www.sunfreeware.com. This would need the Tcl package.

I also found a Perl module 'comm.pl'at http://www.cpan.ch and which is
supposed to do a similar work.

Again, many thanks to all, Eric Voisard
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:27:43 EDT