Send Output to a pipe
Submitted by smartini on Thu, 03/10/2005 - 11:46.
Hi,
is it possible from JNode Commands to send/get I/O (via standard input, output, and error) to another command, using for example a pipe ?
If not, is in Plan ?
Like in Linux, something as:
cat file.txt | grep "my_content"
This is limited to text Strings, but could give a powerful architecture to JNode commands.
I've seen other new Shell experimenting this but with generic Objects ... but this could be an enhancement. Or maybe could be the initial implementation with Object but using only Strings at the moment.
Comments ?
Bye,
Sandro
- Login to post comments
I just made a way for sending
I just made a way for sending the output to a file (look at the "Sending output to a file" topic) and was planing of making input from file and piping too. I think it will be there by this week.
Regards,
Martin
The piping is now available.
The piping is now available. The first command to take pipe is the dir command. You can try it like this:
echo /jnode>/jnode/out.txt
cat /jnode/out.txt|dir
Taking input from file will come later.
Regards,
Martin
I made a little change, so no
I made a little change, so now all command that implements Command can take input from a pipe. As an example you can try it with the kill command.
Regards,
Martin
ps. I guess you will make the grep command