in reply to Interact external Program's child.

external.sh, from the name, appears to be a shell script. What does it contain?

My guess is that in addition to asking questions it sets up the environment for the java program, then runs it. If so, then the answer may be to do all those things in Interact.pl, including calling open3 with a command like 'java ExternalPG --something Answer1 --otherthing Answer2'

Replies are listed 'Best First'.
Re^2: Interact external Program's child.
by gyrson (Novice) on Nov 06, 2011 at 12:30 UTC
    Hello Keszler, thank you for the quick answer.

    I have also thought something like that. But sadly there are 2 things which stands on my way. 1st is that I have no policy to edit the external.sh. the 2nd one was that I wanted to make my own version of it, and when I looked at it, it appeard that:

    more /tools/external.sh ^?ELF^A^B^A^B^B^A^Aj^X4^C-È4 ^F(^X^V^F4^A4ÀÀ^E^Cô^Q^D^A^A^C^Qü^C^Qü^E^ +A^A^C ^E ^KØ"¬^G^A^B^C&h^E&hð^Goÿÿû^F/usr/lib/ld.so.1 ^Aÿÿ^Aÿÿ^Aÿÿ^Aÿÿ^Aÿÿ^Aÿÿ^Aÿÿ^Aÿÿ^Aÿÿ^A^D^A^D^ ... etc

      Well that makes it more difficult.

      If you're running Solaris 8 or 9, or 10 if you have root, the command /usr/ucb/ps -aeguxwwwww <pid of java ExternalPG> should show you the complete command-line and environment variables. With that you could try calling open3 directly on java ExternalPG ... to bypass whatever IO redirection external.sh is doing.

      update - missed the 'e' in the ps command

      first of all let's see if is really a bash script

      file external.sh

      I have no policy to edit the external.sh

      Can you read-only open it?

      If you can, then let's see if zless can open it or not

      zless external.sh
        It looks like an ELF binary, as shown by the more statement. Which makes me think it's highly unlikely to be decompressable into something humanly readable.
        file external.sh shows that it's a ksh-script. zless does not work, but as mentioned to JavaFan, my problem there is not tecnically. I'm not allowed to change/edit/copy that file. It belongs to another OrgUnit which has a very isolated politic.