You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Johan Hertz <jo...@yahoo.se> on 2010/10/24 10:56:05 UTC

Redirect shell output

Hi,

I am trying to redirect output using something like this:

     zfs send rpool/data@test | gzip > mybackup.gz

I can't find a way to do it, is there not a way similar to how ant do it?
http://ant.apache.org/faq.html#shell-redirect-2

Regards
Johan
__________________________________________________
Använder du Yahoo!?
Är du trött på spam?  Yahoo! E-post har det bästa spamskyddet som finns 
http://se.mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [exec] Re: Redirect shell output

Posted by Johan Hertz <jo...@yahoo.se>.
Hi, Siegfried,

I have not had a chance to have a look at this before. But it tried it 
now and it failed, maybe there is something obvious that I am doing 
wrong here.

                 String commandString = "pfexec zfs send 
rpool/data@F20101031 | gzip > F20101031.gz";
                 Executor exec = new DefaultExecutor();
                 exec.setStreamHandler(new PumpStreamHandler());
                 CommandLine cl = new CommandLine(commandString);
                 exec.execute(cl);

Error:
java.lang.Exception:
         at com.katujo.badger.nodes.ExecNode.run(Unknown Source)
         at 
com.katujo.badger.util.EnterExitNodeExecutor.runNoneSyncRoot(Unknown Source)
         at com.katujo.badger.util.EnterExitNodeExecutor.run(Unknown Source)
         at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
         at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
         at java.lang.Thread.run(Thread.java:619)
Caused by: java.io.IOException: Cannot run program "pfexec zfs send 
rpool/data@F20101031 | gzip > F20101031.gz": error=2, No such file or 
directory
         at java.lang.ProcessBuilder.start(ProcessBuilder.java:459)
         at java.lang.Runtime.exec(Runtime.java:593)
         at 
org.apache.commons.exec.launcher.Java13CommandLauncher.exec(Java13CommandLauncher.java:58)
         at 
org.apache.commons.exec.DefaultExecutor.launch(DefaultExecutor.java:246)
         at 
org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:302)
         at 
org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:149)
         at 
org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:136)
         ... 6 more
Caused by: java.io.IOException: error=2, No such file or directory
         at java.lang.UNIXProcess.forkAndExec(Native Method)
         at java.lang.UNIXProcess.<init>(UNIXProcess.java:53)
         at java.lang.ProcessImpl.start(ProcessImpl.java:65)
         at java.lang.ProcessBuilder.start(ProcessBuilder.java:452)
         ... 12 more

I did try to run the exact same thing on the command line and it works, 
do I need to wrap this in a script file or?

Regards
Johan



On 31/10/2010 12:34, Siegfried Goeschl wrote:
> Hi Johan,
>
> sorry for bugging you - any progress from your side? We also 
> appreciate success stories ... :-)
>
> Thanks in advance
>
> Siegfried Goeschl
>
> On 10/24/10 11:33 PM, Johan Hertz wrote:
>> Hi Siegfried,
>>
>> It is a bit late for me to test this now, but thank you very much for
>> pointing me in the right direction.
>>
>> Regards
>> Johan
>>
>> On 24/10/2010 20:51, Siegfried Goeschl wrote:
>>> Hi Johan,
>>>
>>> I used the following test
>>>
>>> >>> Start >>>
>>> public void testMe() throws Exception {
>>> if(OS.isFamilyUnix()) {
>>> File testScript =
>>> TestUtil.resolveScriptForOS("./src/test/scripts/standalone");
>>> System.out.println("Executing the following test script : " +
>>> testScript.getAbsolutePath());
>>> Executor exec = new DefaultExecutor();
>>> exec.setStreamHandler(new PumpStreamHandler());
>>> CommandLine cl = new CommandLine(testScript);
>>> exec.execute(cl);
>>> assertTrue(new File("./target/mybackup.gz").exists());
>>> }
>>> }
>>> <<< End <<<
>>>
>>> using
>>>
>>> cat pom.xml | gzip> ./target/mybackup.gz
>>>
>>> and it worked as expected
>>>
>>> Cheers,
>>>
>>> Siegfried Goeschl
>>>
>>> On 10/24/10 12:36 PM, Johan Hertz wrote:
>>>> Hi Paul,
>>>>
>>>> Sorry about that.
>>>>
>>>> /Regards
>>>> Johan
>>>>
>>>> On 24/10/2010 11:11, Paul Libbrecht wrote:
>>>>> Johan,
>>>>>
>>>>> which project are you asking this from?
>>>>> commons-exec?
>>>>> Please read the netiquette of this list... you need to make this
>>>>> clear otherwise you don't reach the right people.
>>>>>
>>>>> paul
>>>>>
>>>>>
>>>>> On 24 oct. 2010, at 10:56, Johan Hertz wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I am trying to redirect output using something like this:
>>>>>>
>>>>>> zfs send rpool/data@test | gzip> mybackup.gz
>>>>>>
>>>>>> I can't find a way to do it, is there not a way similar to how ant
>>>>>> do it?
>>>>>> http://ant.apache.org/faq.html#shell-redirect-2
>>>>>>
>>>>>> Regards
>>>>>> Johan
>>>>>> __________________________________________________
>>>>>> Använder du Yahoo!?
>>>>>> Är du trött på spam? Yahoo! E-post har det bästa spamskyddet som
>>>>>> finns http://se.mail.yahoo.com
>>>>>> --------------------------------------------------------------------- 
>>>>>>
>>>>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>>>>> For additional commands, e-mail: user-help@commons.apache.org
>>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>>>> For additional commands, e-mail: user-help@commons.apache.org
>>>>>
>>>>>
>>>>
>>>> __________________________________________________
>>>> Använder du Yahoo!?
>>>> Är du trött på spam? Yahoo! E-post har det bästa spamskyddet som
>>>> finns http://se.mail.yahoo.com
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>>> For additional commands, e-mail: user-help@commons.apache.org
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>> For additional commands, e-mail: user-help@commons.apache.org
>>>
>>>
>>
>> __________________________________________________
>> Använder du Yahoo!?
>> Är du trött på spam? Yahoo! E-post har det bästa spamskyddet som finns
>> http://se.mail.yahoo.com
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>> For additional commands, e-mail: user-help@commons.apache.org
>>
>>
>

__________________________________________________
Använder du Yahoo!?
Är du trött på spam?  Yahoo! E-post har det bästa spamskyddet som finns 
http://se.mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


RE: [exec] Re: Redirect shell output

Posted by Martin Gainty <mg...@hotmail.com>.
you found a bug

any volunteers to rid the bug?

Martin 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
 

> Date: Sun, 31 Oct 2010 13:58:27 +0000
> From: johan_hertz@yahoo.se
> To: user@commons.apache.org
> Subject: Re: [exec] Re: Redirect shell output
> 
> Hi again,
> 
> I have tried to wrap it in a script now and it works. I am just a bit 
> curious is there any reason why the command (pfexec zfs send 
> rpool/data@F20101031 | gzip > F20101031.gz) can't work as it is?
> 
> Regards
> Johan
> 
> On 31/10/2010 12:34, Siegfried Goeschl wrote:
> > Hi Johan,
> >
> > sorry for bugging you - any progress from your side? We also 
> > appreciate success stories ... :-)
> >
> > Thanks in advance
> >
> > Siegfried Goeschl
> >
> > On 10/24/10 11:33 PM, Johan Hertz wrote:
> >> Hi Siegfried,
> >>
> >> It is a bit late for me to test this now, but thank you very much for
> >> pointing me in the right direction.
> >>
> >> Regards
> >> Johan
> >>
> >> On 24/10/2010 20:51, Siegfried Goeschl wrote:
> >>> Hi Johan,
> >>>
> >>> I used the following test
> >>>
> >>> >>> Start >>>
> >>> public void testMe() throws Exception {
> >>> if(OS.isFamilyUnix()) {
> >>> File testScript =
> >>> TestUtil.resolveScriptForOS("./src/test/scripts/standalone");
> >>> System.out.println("Executing the following test script : " +
> >>> testScript.getAbsolutePath());
> >>> Executor exec = new DefaultExecutor();
> >>> exec.setStreamHandler(new PumpStreamHandler());
> >>> CommandLine cl = new CommandLine(testScript);
> >>> exec.execute(cl);
> >>> assertTrue(new File("./target/mybackup.gz").exists());
> >>> }
> >>> }
> >>> <<< End <<<
> >>>
> >>> using
> >>>
> >>> cat pom.xml | gzip> ./target/mybackup.gz
> >>>
> >>> and it worked as expected
> >>>
> >>> Cheers,
> >>>
> >>> Siegfried Goeschl
> >>>
> >>> On 10/24/10 12:36 PM, Johan Hertz wrote:
> >>>> Hi Paul,
> >>>>
> >>>> Sorry about that.
> >>>>
> >>>> /Regards
> >>>> Johan
> >>>>
> >>>> On 24/10/2010 11:11, Paul Libbrecht wrote:
> >>>>> Johan,
> >>>>>
> >>>>> which project are you asking this from?
> >>>>> commons-exec?
> >>>>> Please read the netiquette of this list... you need to make this
> >>>>> clear otherwise you don't reach the right people.
> >>>>>
> >>>>> paul
> >>>>>
> >>>>>
> >>>>> On 24 oct. 2010, at 10:56, Johan Hertz wrote:
> >>>>>
> >>>>>> Hi,
> >>>>>>
> >>>>>> I am trying to redirect output using something like this:
> >>>>>>
> >>>>>> zfs send rpool/data@test | gzip> mybackup.gz
> >>>>>>
> >>>>>> I can't find a way to do it, is there not a way similar to how ant
> >>>>>> do it?
> >>>>>> http://ant.apache.org/faq.html#shell-redirect-2
> >>>>>>
> >>>>>> Regards
> >>>>>> Johan
> >>>>>> __________________________________________________
> >>>>>> Använder du Yahoo!?
> >>>>>> Är du trött på spam? Yahoo! E-post har det bästa spamskyddet som
> >>>>>> finns http://se.mail.yahoo.com
> >>>>>> --------------------------------------------------------------------- 
> >>>>>>
> >>>>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> >>>>>> For additional commands, e-mail: user-help@commons.apache.org
> >>>>>>
> >>>>>
> >>>>> ---------------------------------------------------------------------
> >>>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> >>>>> For additional commands, e-mail: user-help@commons.apache.org
> >>>>>
> >>>>>
> >>>>
> >>>> __________________________________________________
> >>>> Använder du Yahoo!?
> >>>> Är du trött på spam? Yahoo! E-post har det bästa spamskyddet som
> >>>> finns http://se.mail.yahoo.com
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> >>>> For additional commands, e-mail: user-help@commons.apache.org
> >>>>
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> >>> For additional commands, e-mail: user-help@commons.apache.org
> >>>
> >>>
> >>
> >> __________________________________________________
> >> Använder du Yahoo!?
> >> Är du trött på spam? Yahoo! E-post har det bästa spamskyddet som finns
> >> http://se.mail.yahoo.com
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> >> For additional commands, e-mail: user-help@commons.apache.org
> >>
> >>
> >
> 
> __________________________________________________
> Använder du Yahoo!?
> Är du trött på spam? Yahoo! E-post har det bästa spamskyddet som finns 
> http://se.mail.yahoo.com 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
> 
 		 	   		  

Re: [exec] Re: Redirect shell output

Posted by Johan Hertz <jo...@yahoo.se>.
Hi again,

I have tried to wrap it in a script now and it works. I am just a bit 
curious is there any reason why the command (pfexec zfs send 
rpool/data@F20101031 | gzip > F20101031.gz) can't work as it is?

Regards
Johan

On 31/10/2010 12:34, Siegfried Goeschl wrote:
> Hi Johan,
>
> sorry for bugging you - any progress from your side? We also 
> appreciate success stories ... :-)
>
> Thanks in advance
>
> Siegfried Goeschl
>
> On 10/24/10 11:33 PM, Johan Hertz wrote:
>> Hi Siegfried,
>>
>> It is a bit late for me to test this now, but thank you very much for
>> pointing me in the right direction.
>>
>> Regards
>> Johan
>>
>> On 24/10/2010 20:51, Siegfried Goeschl wrote:
>>> Hi Johan,
>>>
>>> I used the following test
>>>
>>> >>> Start >>>
>>> public void testMe() throws Exception {
>>> if(OS.isFamilyUnix()) {
>>> File testScript =
>>> TestUtil.resolveScriptForOS("./src/test/scripts/standalone");
>>> System.out.println("Executing the following test script : " +
>>> testScript.getAbsolutePath());
>>> Executor exec = new DefaultExecutor();
>>> exec.setStreamHandler(new PumpStreamHandler());
>>> CommandLine cl = new CommandLine(testScript);
>>> exec.execute(cl);
>>> assertTrue(new File("./target/mybackup.gz").exists());
>>> }
>>> }
>>> <<< End <<<
>>>
>>> using
>>>
>>> cat pom.xml | gzip> ./target/mybackup.gz
>>>
>>> and it worked as expected
>>>
>>> Cheers,
>>>
>>> Siegfried Goeschl
>>>
>>> On 10/24/10 12:36 PM, Johan Hertz wrote:
>>>> Hi Paul,
>>>>
>>>> Sorry about that.
>>>>
>>>> /Regards
>>>> Johan
>>>>
>>>> On 24/10/2010 11:11, Paul Libbrecht wrote:
>>>>> Johan,
>>>>>
>>>>> which project are you asking this from?
>>>>> commons-exec?
>>>>> Please read the netiquette of this list... you need to make this
>>>>> clear otherwise you don't reach the right people.
>>>>>
>>>>> paul
>>>>>
>>>>>
>>>>> On 24 oct. 2010, at 10:56, Johan Hertz wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I am trying to redirect output using something like this:
>>>>>>
>>>>>> zfs send rpool/data@test | gzip> mybackup.gz
>>>>>>
>>>>>> I can't find a way to do it, is there not a way similar to how ant
>>>>>> do it?
>>>>>> http://ant.apache.org/faq.html#shell-redirect-2
>>>>>>
>>>>>> Regards
>>>>>> Johan
>>>>>> __________________________________________________
>>>>>> Använder du Yahoo!?
>>>>>> Är du trött på spam? Yahoo! E-post har det bästa spamskyddet som
>>>>>> finns http://se.mail.yahoo.com
>>>>>> --------------------------------------------------------------------- 
>>>>>>
>>>>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>>>>> For additional commands, e-mail: user-help@commons.apache.org
>>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>>>> For additional commands, e-mail: user-help@commons.apache.org
>>>>>
>>>>>
>>>>
>>>> __________________________________________________
>>>> Använder du Yahoo!?
>>>> Är du trött på spam? Yahoo! E-post har det bästa spamskyddet som
>>>> finns http://se.mail.yahoo.com
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>>> For additional commands, e-mail: user-help@commons.apache.org
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>> For additional commands, e-mail: user-help@commons.apache.org
>>>
>>>
>>
>> __________________________________________________
>> Använder du Yahoo!?
>> Är du trött på spam? Yahoo! E-post har det bästa spamskyddet som finns
>> http://se.mail.yahoo.com
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>> For additional commands, e-mail: user-help@commons.apache.org
>>
>>
>

__________________________________________________
Använder du Yahoo!?
Är du trött på spam?  Yahoo! E-post har det bästa spamskyddet som finns 
http://se.mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [exec] Re: Redirect shell output

Posted by Siegfried Goeschl <sg...@gmx.at>.
Hi Johan,

sorry for bugging you - any progress from your side? We also appreciate 
success stories ... :-)

Thanks in advance

Siegfried Goeschl

On 10/24/10 11:33 PM, Johan Hertz wrote:
> Hi Siegfried,
>
> It is a bit late for me to test this now, but thank you very much for
> pointing me in the right direction.
>
> Regards
> Johan
>
> On 24/10/2010 20:51, Siegfried Goeschl wrote:
>> Hi Johan,
>>
>> I used the following test
>>
>> >>> Start >>>
>> public void testMe() throws Exception {
>> if(OS.isFamilyUnix()) {
>> File testScript =
>> TestUtil.resolveScriptForOS("./src/test/scripts/standalone");
>> System.out.println("Executing the following test script : " +
>> testScript.getAbsolutePath());
>> Executor exec = new DefaultExecutor();
>> exec.setStreamHandler(new PumpStreamHandler());
>> CommandLine cl = new CommandLine(testScript);
>> exec.execute(cl);
>> assertTrue(new File("./target/mybackup.gz").exists());
>> }
>> }
>> <<< End <<<
>>
>> using
>>
>> cat pom.xml | gzip> ./target/mybackup.gz
>>
>> and it worked as expected
>>
>> Cheers,
>>
>> Siegfried Goeschl
>>
>> On 10/24/10 12:36 PM, Johan Hertz wrote:
>>> Hi Paul,
>>>
>>> Sorry about that.
>>>
>>> /Regards
>>> Johan
>>>
>>> On 24/10/2010 11:11, Paul Libbrecht wrote:
>>>> Johan,
>>>>
>>>> which project are you asking this from?
>>>> commons-exec?
>>>> Please read the netiquette of this list... you need to make this
>>>> clear otherwise you don't reach the right people.
>>>>
>>>> paul
>>>>
>>>>
>>>> On 24 oct. 2010, at 10:56, Johan Hertz wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I am trying to redirect output using something like this:
>>>>>
>>>>> zfs send rpool/data@test | gzip> mybackup.gz
>>>>>
>>>>> I can't find a way to do it, is there not a way similar to how ant
>>>>> do it?
>>>>> http://ant.apache.org/faq.html#shell-redirect-2
>>>>>
>>>>> Regards
>>>>> Johan
>>>>> __________________________________________________
>>>>> Använder du Yahoo!?
>>>>> Är du trött på spam? Yahoo! E-post har det bästa spamskyddet som
>>>>> finns http://se.mail.yahoo.com
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>>>> For additional commands, e-mail: user-help@commons.apache.org
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>>> For additional commands, e-mail: user-help@commons.apache.org
>>>>
>>>>
>>>
>>> __________________________________________________
>>> Använder du Yahoo!?
>>> Är du trött på spam? Yahoo! E-post har det bästa spamskyddet som
>>> finns http://se.mail.yahoo.com
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>> For additional commands, e-mail: user-help@commons.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>> For additional commands, e-mail: user-help@commons.apache.org
>>
>>
>
> __________________________________________________
> Använder du Yahoo!?
> Är du trött på spam? Yahoo! E-post har det bästa spamskyddet som finns
> http://se.mail.yahoo.com
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [exec] Re: Redirect shell output

Posted by Johan Hertz <jo...@yahoo.se>.
Hi Siegfried,

It is a bit late for me to test this now, but thank you very much for 
pointing me in the right direction.

Regards
Johan

On 24/10/2010 20:51, Siegfried Goeschl wrote:
> Hi Johan,
>
> I used the following test
>
> >>>  Start >>>
>     public void testMe() throws Exception {
>         if(OS.isFamilyUnix()) {
>             File testScript = 
> TestUtil.resolveScriptForOS("./src/test/scripts/standalone");
>             System.out.println("Executing the following test script : 
> " + testScript.getAbsolutePath());
>             Executor exec = new DefaultExecutor();
>             exec.setStreamHandler(new PumpStreamHandler());
>             CommandLine cl = new CommandLine(testScript);
>             exec.execute(cl);
>             assertTrue(new File("./target/mybackup.gz").exists());
>         }
>     }
> <<< End <<<
>
> using
>
> cat pom.xml | gzip> ./target/mybackup.gz
>
> and it worked as expected
>
> Cheers,
>
> Siegfried Goeschl
>
> On 10/24/10 12:36 PM, Johan Hertz wrote:
>> Hi Paul,
>>
>> Sorry about that.
>>
>> /Regards
>> Johan
>>
>> On 24/10/2010 11:11, Paul Libbrecht wrote:
>>> Johan,
>>>
>>> which project are you asking this from?
>>> commons-exec?
>>> Please read the netiquette of this list... you need to make this 
>>> clear otherwise you don't reach the right people.
>>>
>>> paul
>>>
>>>
>>> On 24 oct. 2010, at 10:56, Johan Hertz wrote:
>>>
>>>> Hi,
>>>>
>>>> I am trying to redirect output using something like this:
>>>>
>>>>     zfs send rpool/data@test | gzip>  mybackup.gz
>>>>
>>>> I can't find a way to do it, is there not a way similar to how ant 
>>>> do it?
>>>> http://ant.apache.org/faq.html#shell-redirect-2
>>>>
>>>> Regards
>>>> Johan
>>>> __________________________________________________
>>>> Använder du Yahoo!?
>>>> Är du trött på spam?  Yahoo! E-post har det bästa spamskyddet som 
>>>> finns http://se.mail.yahoo.com
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>>> For additional commands, e-mail: user-help@commons.apache.org
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>> For additional commands, e-mail: user-help@commons.apache.org
>>>
>>>
>>
>> __________________________________________________
>> Använder du Yahoo!?
>> Är du trött på spam?  Yahoo! E-post har det bästa spamskyddet som 
>> finns http://se.mail.yahoo.com
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>> For additional commands, e-mail: user-help@commons.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>

__________________________________________________
Använder du Yahoo!?
Är du trött på spam?  Yahoo! E-post har det bästa spamskyddet som finns 
http://se.mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [exec] Re: Redirect shell output

Posted by Siegfried Goeschl <si...@it20one.at>.
Hi Johan,

I used the following test

 >>>  Start >>>
     public void testMe() throws Exception {
         if(OS.isFamilyUnix()) {
             File testScript = 
TestUtil.resolveScriptForOS("./src/test/scripts/standalone");
             System.out.println("Executing the following test script : " 
+ testScript.getAbsolutePath());
             Executor exec = new DefaultExecutor();
             exec.setStreamHandler(new PumpStreamHandler());
             CommandLine cl = new CommandLine(testScript);
             exec.execute(cl);
             assertTrue(new File("./target/mybackup.gz").exists());
         }
     }
<<< End <<<

using

cat pom.xml | gzip> ./target/mybackup.gz

and it worked as expected

Cheers,

Siegfried Goeschl

On 10/24/10 12:36 PM, Johan Hertz wrote:
> Hi Paul,
>
> Sorry about that.
>
> /Regards
> Johan
>
> On 24/10/2010 11:11, Paul Libbrecht wrote:
>> Johan,
>>
>> which project are you asking this from?
>> commons-exec?
>> Please read the netiquette of this list... you need to make this 
>> clear otherwise you don't reach the right people.
>>
>> paul
>>
>>
>> On 24 oct. 2010, at 10:56, Johan Hertz wrote:
>>
>>> Hi,
>>>
>>> I am trying to redirect output using something like this:
>>>
>>>     zfs send rpool/data@test | gzip>  mybackup.gz
>>>
>>> I can't find a way to do it, is there not a way similar to how ant 
>>> do it?
>>> http://ant.apache.org/faq.html#shell-redirect-2
>>>
>>> Regards
>>> Johan
>>> __________________________________________________
>>> Använder du Yahoo!?
>>> Är du trött på spam?  Yahoo! E-post har det bästa spamskyddet som 
>>> finns http://se.mail.yahoo.com
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>> For additional commands, e-mail: user-help@commons.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>> For additional commands, e-mail: user-help@commons.apache.org
>>
>>
>
> __________________________________________________
> Använder du Yahoo!?
> Är du trött på spam?  Yahoo! E-post har det bästa spamskyddet som 
> finns http://se.mail.yahoo.com
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


[exec] Re: Redirect shell output

Posted by Johan Hertz <jo...@yahoo.se>.
Hi Paul,

Sorry about that.

/Regards
Johan

On 24/10/2010 11:11, Paul Libbrecht wrote:
> Johan,
>
> which project are you asking this from?
> commons-exec?
> Please read the netiquette of this list... you need to make this clear otherwise you don't reach the right people.
>
> paul
>
>
> On 24 oct. 2010, at 10:56, Johan Hertz wrote:
>
>> Hi,
>>
>> I am trying to redirect output using something like this:
>>
>>     zfs send rpool/data@test | gzip>  mybackup.gz
>>
>> I can't find a way to do it, is there not a way similar to how ant do it?
>> http://ant.apache.org/faq.html#shell-redirect-2
>>
>> Regards
>> Johan
>> __________________________________________________
>> Använder du Yahoo!?
>> Är du trött på spam?  Yahoo! E-post har det bästa spamskyddet som finns http://se.mail.yahoo.com
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>> For additional commands, e-mail: user-help@commons.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>

__________________________________________________
Använder du Yahoo!?
Är du trött på spam?  Yahoo! E-post har det bästa spamskyddet som finns 
http://se.mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: Redirect shell output

Posted by Paul Libbrecht <pa...@activemath.org>.
Johan,

which project are you asking this from?
commons-exec?
Please read the netiquette of this list... you need to make this clear otherwise you don't reach the right people.

paul


On 24 oct. 2010, at 10:56, Johan Hertz wrote:

> Hi,
> 
> I am trying to redirect output using something like this:
> 
>    zfs send rpool/data@test | gzip > mybackup.gz
> 
> I can't find a way to do it, is there not a way similar to how ant do it?
> http://ant.apache.org/faq.html#shell-redirect-2
> 
> Regards
> Johan
> __________________________________________________
> Använder du Yahoo!?
> Är du trött på spam?  Yahoo! E-post har det bästa spamskyddet som finns http://se.mail.yahoo.com 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org