You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Hiram Chirino (JIRA)" <ji...@apache.org> on 2009/07/13 21:15:17 UTC

[jira] Created: (FELIX-1356) Piping output from multiple statements on single line should behave similar to how Unix shells handle redirection.

Piping output from multiple statements on single line should behave similar to how Unix shells handle redirection.
------------------------------------------------------------------------------------------------------------------

                 Key: FELIX-1356
                 URL: https://issues.apache.org/jira/browse/FELIX-1356
             Project: Felix
          Issue Type: Improvement
            Reporter: Hiram Chirino


Use compare the command and result of these unix shell statements:

$ echo hello ; echo hello | echo world
hello
world

With the gogo equivalent:

$ echo hello ; echo hello | echo world
world


Seems like in the gogo case the pipe is applied to both statements while in the unix case, the pipe is only applied to the statement the pipe is defined in.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-1356) Piping output from multiple statements on single line should behave similar to how Unix shells handle redirection.

Posted by "Yongjin Xu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1356?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12779470#action_12779470 ] 

Yongjin Xu commented on FELIX-1356:
-----------------------------------

I find following command works

echo "123" <echo "234"<echo "456"|grep '3'
and it produces
123 234 456


> Piping output from multiple statements on single line should behave similar to how Unix shells handle redirection.
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: FELIX-1356
>                 URL: https://issues.apache.org/jira/browse/FELIX-1356
>             Project: Felix
>          Issue Type: Improvement
>            Reporter: Hiram Chirino
>
> Use compare the command and result of these unix shell statements:
> $ echo hello ; echo hello | echo world
> hello
> world
> With the gogo equivalent:
> $ echo hello ; echo hello | echo world
> world
> Seems like in the gogo case the pipe is applied to both statements while in the unix case, the pipe is only applied to the statement the pipe is defined in.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-1356) Piping output from multiple statements on single line should behave similar to how Unix shells handle redirection.

Posted by "Hiram Chirino (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1356?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12730899#action_12730899 ] 

Hiram Chirino commented on FELIX-1356:
--------------------------------------

I think it should be easy to argue that the RFC grammar is counter intuitive due to the following example:

Say the user runs:

> a-command 
> b-command
> c-command | grep 'a'

I think he would expect that above statements would be interpreted as being 1 program entered into an interactive console.  When actually it's 3 programs being run.  And further more it would be intuitive to think that the above would be the equivalent of the following closure:

{  a-command ; b-command ; c-command | grep 'a' }

Which currently it is not.

> Piping output from multiple statements on single line should behave similar to how Unix shells handle redirection.
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: FELIX-1356
>                 URL: https://issues.apache.org/jira/browse/FELIX-1356
>             Project: Felix
>          Issue Type: Improvement
>            Reporter: Hiram Chirino
>
> Use compare the command and result of these unix shell statements:
> $ echo hello ; echo hello | echo world
> hello
> world
> With the gogo equivalent:
> $ echo hello ; echo hello | echo world
> world
> Seems like in the gogo case the pipe is applied to both statements while in the unix case, the pipe is only applied to the statement the pipe is defined in.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-1356) Piping output from multiple statements on single line should behave similar to how Unix shells handle redirection.

Posted by "Derek Baum (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1356?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12730493#action_12730493 ] 

Derek Baum commented on FELIX-1356:
-----------------------------------

> Seems like in the gogo case the pipe is applied to both statements while in the unix case, the pipe is only applied to the statement the pipe is defined in.

yes, this is as defined in RFC132:

program ::= statements ( '|' statements ) *
statements ::= statement ( ';' statement ) *

so the pipe is defined as connecting groups of statements, separated by ;

However, we could suggest it is redefined to be more Unix like (fewer surprises for those who know Unix).
We could then use parenthesis () to group statement, just as you would in bash:

> (echo hello ; echo hello) | echo world

This would require not using parenthesis to create literal LDAP expressions, as they do at present, as I mentioned in the comment onhttps://issues.apache.org/jira/browse/FELIX-1325

Derek

> Piping output from multiple statements on single line should behave similar to how Unix shells handle redirection.
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: FELIX-1356
>                 URL: https://issues.apache.org/jira/browse/FELIX-1356
>             Project: Felix
>          Issue Type: Improvement
>            Reporter: Hiram Chirino
>
> Use compare the command and result of these unix shell statements:
> $ echo hello ; echo hello | echo world
> hello
> world
> With the gogo equivalent:
> $ echo hello ; echo hello | echo world
> world
> Seems like in the gogo case the pipe is applied to both statements while in the unix case, the pipe is only applied to the statement the pipe is defined in.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.