[teiid-issues] [JBoss JIRA] Commented: (TEIID-1355) adminshell.bat cannot read script from stdin

Aleksandar Kostadinov (JIRA) jira-events at lists.jboss.org
Sat Nov 20 21:55:53 EST 2010


    [ https://jira.jboss.org/browse/TEIID-1355?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12564455#comment-12564455 ] 

Aleksandar Kostadinov commented on TEIID-1355:
----------------------------------------------

The problem is not that groovy doesn't recognize the commands sent through std in on windows. It just doesn't see them and waits for input on the terminal.

echo "println 'hello'" | adminshell.bat

here adminshell starts and waits for interactive input. The println expression has gone nowhere.

I have investigated the issue and it seems to lives inside the groovy shell [1] which uses the JLine library for handling user input. I couldn't really disable jline by the system properties described in the jline documentation but I observed changes in behavior. Also jython is using jline for interactive and another implementation for non-interactive uses to avoid unexpected stdin problems [2].

So it seems fixing the behavior on windows would not be so easy as I have thought (without removing convenience for interactive users). I'm leaving to you the decision if you keep the issue open. IMHO a real fix would be to make jline detect if stdin is interactive or not (if possible) and handle situation appropriately. A line in the adminshell docs describing the issue would be also a good thing to do.

Thank you.

[1] https://svn.codehaus.org/groovy/trunk/groovy/groovy-core/src/main/org/codehaus/groovy/tools/shell/Main.groovy
[2] https://fisheye3.atlassian.com/browse/~raw,r=6634/jython/trunk/jython/src/org/python/util/jython.java /see newInterpreter()/

P.S. JIRA doesn't send email notifications to me for comments to this issue which is strange, anybody else having this problem?

> adminshell.bat cannot read script from stdin
> --------------------------------------------
>
>                 Key: TEIID-1355
>                 URL: https://jira.jboss.org/browse/TEIID-1355
>             Project: Teiid
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 7.1
>         Environment: windows
>            Reporter: Aleksandar Kostadinov
>
> On windows adminshell doesn't read script if supplied on stdin. It looks like it is reading from terminal (unlike adminshell on linux). I see that one can supply expression as first argument to adminshell but it seems to accept only a single expression and additionally complex expressions are a hell to escape properly.
> Assuming adminshell is intended to be used for automating administrative tasks, it needs a straightforward way to execute scripts non-interactively so current behavior on windows needs to be fixed.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the teiid-issues mailing list