Can bsh scripts could handle piped input from other commands ?

Frank Misa <[email protected]> Fri, 30 Jan 2009 19:39:21 +0000
Newsgroups gmane.comp.java.beanshell.user
Message-ID <[email protected]>
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

_________________________________________________________________
So many new options, so little time. Windows Live Messenger.
http://www.microsoft.com/windows/windowslive/messenger.aspx

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

_______________________________________________
Beanshell-users mailing list
Beanshell-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/beanshell-users
bsh (application/octet-stream, 1.7 KB) - not displayed
myScript.bsh (application/octet-stream, 325 B) - not displayed