You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@bigtop.apache.org by Jay Vyas <ja...@gmail.com> on 2014/02/26 19:26:41 UTC

Any reason why ">>" might fail in the ITest Shell.java?

Hi bigtop !

I've been trying to do something like :

sh.exec("echo \"hi\" >> myfile.txt");

In ITest.  However, the file "myfile.txt" is coming up empty.

Should ITest accept any inline bash command?  I assume "yes" but maybe
something funny happens when using pipes/streams inline ... ?

-- 
Jay Vyas
http://jayunit100.blogspot.com

Re: Any reason why ">>" might fail in the ITest Shell.java?

Posted by Jay Vyas <ja...@gmail.com>.
Thanks cos, maybe when doing minor rewriting during debugging, that was the
issue  which i might have fixed inadvertently

Re: Any reason why ">>" might fail in the ITest Shell.java?

Posted by Konstantin Boudnik <co...@apache.org>.
Another thing to consider is to use triple-quoted strings (""" blah """) to
prevent any kinda of possible interpretation of a string's internals. There's
actually a difference between "" and '' strings. 

You might find this useful
    http://groovy.codehaus.org/Strings+and+GString

Cos

On Wed, Feb 26, 2014 at 06:47PM, Jay Vyas wrote:
> Well, nevermind, ive tested it in a more simple scenario and echo/cat seem
> to work okay, each line of output goes to an array element returned in the
> getOut() call.
> 
> 
> On Wed, Feb 26, 2014 at 1:26 PM, Jay Vyas <ja...@gmail.com> wrote:
> 
> > Hi bigtop !
> >
> > I've been trying to do something like :
> >
> > sh.exec("echo \"hi\" >> myfile.txt");
> >
> > In ITest.  However, the file "myfile.txt" is coming up empty.
> >
> > Should ITest accept any inline bash command?  I assume "yes" but maybe
> > something funny happens when using pipes/streams inline ... ?
> >
> > --
> > Jay Vyas
> > http://jayunit100.blogspot.com
> >
> 
> 
> 
> -- 
> Jay Vyas
> http://jayunit100.blogspot.com

Re: Any reason why ">>" might fail in the ITest Shell.java?

Posted by Jay Vyas <ja...@gmail.com>.
Well, nevermind, ive tested it in a more simple scenario and echo/cat seem
to work okay, each line of output goes to an array element returned in the
getOut() call.


On Wed, Feb 26, 2014 at 1:26 PM, Jay Vyas <ja...@gmail.com> wrote:

> Hi bigtop !
>
> I've been trying to do something like :
>
> sh.exec("echo \"hi\" >> myfile.txt");
>
> In ITest.  However, the file "myfile.txt" is coming up empty.
>
> Should ITest accept any inline bash command?  I assume "yes" but maybe
> something funny happens when using pipes/streams inline ... ?
>
> --
> Jay Vyas
> http://jayunit100.blogspot.com
>



-- 
Jay Vyas
http://jayunit100.blogspot.com