in reply to Re: Interact external Program's child.
in thread Interact external Program's child.

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

Replies are listed 'Best First'.
Re^3: Interact external Program's child.
by keszler (Priest) on Nov 06, 2011 at 12:55 UTC

    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

Re^3: Interact external Program's child.
by pvaldes (Chaplain) on Nov 06, 2011 at 12:50 UTC

    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
      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.
        file external.sh shows that it's a ksh-script.
        That conflicts with the output of "more /tools/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.