🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #7432

Re: How to use getRuntime().exec and Unix Pipe??

#7432
From: dnoyeB
Date: Fri, 22 Jun 2001 21:14
39 lines
1604 bytes
Please describe your problem.


"Tom Harrop" <tch1@osi.com> wrote in message news:3b33b159$1_2@dnews...
> Ok, I know how to use the getRuntime().exec command.
> But, I can't seem to get this to work with a Unix Pipe???
>
> Any ideas?
>
> Thanks
>
> try {
> String[] kshCommand =
>   {
>     "/bin/ksh"
>     ,"-c"
>     ,"command"
>     ,"command_arg1"
>     ,"command_arg2"
>     ,"|"
>     ,"grep xyz"
>   };
> java.lang.Process p = java.lang.Runtime.getRuntime().exec(kshCommand);
>
> // deal with stdout, stdin and stderr of the child process using
>  p.getInputStream();
>  p.getOutputStream();
>  p.getErrorStream();
>
> // Now wait for the process completion
> p.waitFor();
> } catch (IOException ioe) {
> }
>
>
>
>
>
>
Technical Details
Message-ID: <3b342118$1_2@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews
References: <3b33b159$1_2@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,88fbb3b1aa86f386
X-Google-Attributes: gidf74b3,public
X-Google-ArrivalTime: 2001-06-22 21:56:28 PST
From: "dnoyeB" <lamont_gilbert @ rigidsoftware.com>
Newsgroups: borland.public.jbuilder.java.language
References: <3b33b159$1_2@dnews>
Subject: Re: How to use getRuntime().exec and Unix Pipe??
Date: Fri, 22 Jun 2001 17:14:26 -0400
Lines: 41
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
NNTP-Posting-Host: 24.181.226.14
Message-ID: <3b342118$1_2@dnews>
X-Trace: dnews 993272088 24.181.226.14 (22 Jun 2001 21:54:48 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews