Re: Can bsh scripts could handle piped input from other commands ?

Jesse Pavel <jpavel-FrUbXkNCsVf2fBVCVOL8/[email protected]> Fri, 30 Jan 2009 15:21:38 -0500
Newsgroups gmane.comp.java.beanshell.user
Message-ID <[email protected]>
Hi Frank,

> grep -i 'myTest' *myFiles.txt | bsh myScript

This syntax should work on Linux/Unix/etc. Perhaps piping doesn't
operate properly on Cygwin when you mix in non-Cygwin executables?

~Jesse


On Fri, Jan 30, 2009 at 2:39 PM, Frank Misa <[email protected]> wrote:
> Hi All,
>
> I'd like to know if it's possible for bsh scripts to handle/access piped
> input from other unix commands ?
> For example: If "bsh" is a script/command that launches java
> bsh.Interpreter...
>
>  grep -i 'myTest' *myFiles.txt | bsh myScript
>  grep -i 'myTest' *myFiles.txt > bsh myScript
>
> I've attached one "wrapper" (that I found on the net) that allows execution
> of bsh scripts ?
> What would this wrapper need to do to pass stdio to my bsh script -- and is
> this stdio "visible" from within my bean shell script.
>
> My simple test -- see attached script: myScript -- works if I type in
> characters after running the script... just echos back what I type...
> But the script does not work if I try to pipe those characters in from some
> other command ?
>
> $ grep -i 'logging.properties' *.properties | bsh myScript.bsh
> BeanShell test.... processing stdio
> Done...
>
> Following outputs nothing...
> $ grep -i 'logging.properties' *.properties > bsh myScript.bsh
>
> Was wondering -- is BeanShell used by the community in this manner ? Can it
> be done...
> Looking forward to hearing some ideas....
>
> Thanks
> Frank

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword