472,992 Members | 3,578 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,992 software developers and data experts.

how to use open with many input streams and capture output?

Hello,

There is an operation which can be performed at the shell prompt the
following way:

some_prg [some_inputfile_1] [some_inputfile_2] > result_file

However, before "some_prg" can use files, they have to be converted and it
can be done like this:

some_prg <(convert inputfile_1) <(convert inputfile_2) > result_file

It works perfectly at shell prompt.

I would like to start the above sequence in perl script using "open"
command:

open(SOME_OUTPUT,"some_prg <(convert inputfile_1) <(convert inputfile_2) |
");

When I try to run the script and capture SOME_OUTPUT, I get the following
error:

sh: -c: line 1: syntax error near unexpected token `('
sh: -c: line 1: `some_prg <(convert file_1) <(convert file_2)'

Is there any way to solve that syntax error without writing extra shell
scripts as I would like to have all the code in a single perl script?

Thank you for any help.

Pawel Banys

Jul 19 '05 #1
1 3786
Pawel Banys wrote:
some_prg <(convert inputfile_1) <(convert inputfile_2) > result_file

It works perfectly at shell prompt.


Which shell? That syntax is not valid for the /bin/sh (Bourne) shell,
which is what perl calls upon. For the Bourne shell, try this:

(convert inputfile_1; convert inputfile_2) | some_prog > result_file.

-Joe

P.S. Next time post to comp.lang.perl.misc, not comp.lang.perl .
Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Gert Schumann | last post by:
I'm operating on sun OS 5.6 I ping a host every 10 seconds to get knowlegde wheather it is running or not. After about one and a half hour I get this Exception: java.io.IOException: Too many open...
13
by: J. Campbell | last post by:
I'm wanting to output a text header file in front of the data portion of an output file. However when I use "\n" or "endl" as end of line, it just puts a 0x0a in the file(which is...
4
by: Oz | last post by:
This is long. Bear with me, as I will really go through all the convoluted stuff that shows there is a problem with streams (at least when used to redirect stdout). The basic idea is that my...
4
by: jas | last post by:
I have a basic client/server socket situation setup....where the server accepts a connection and then waits for commands. On the client side, I create a socket, connect to the server...then I...
4
by: Ryan Liu | last post by:
TcpClient has a method called GetworkStream GetStream(); So in other words, there is only one stream associate with it for input and output, right? So while it is receiving, it can not send, and...
8
by: someone | last post by:
I'm making an program that encodes text, and then writes it into another text file. The problem is that I can't seem to get the "file exists" checking right. If I use the command (coder is the...
2
by: gopala | last post by:
Hi, I am pretty new to python but i do have experience with c++. As a part of learning exercise i wrote a python script to insert beautifying comments(with name, problem...) to our lab program...
0
by: starkman | last post by:
Hello all, I have been having some problems with using Open CV to play an avi file. I am currently creating a eye input based system, where the mouse is replaced by an eye tracker. I am...
4
by: George Oliver | last post by:
hi, I'm a novice programmer trying to better define a hobby project I'm thinking of. What I would like to do is take a program and embed it or put it within a Python-run GUI, using the GUI just...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...
3
SueHopson
by: SueHopson | last post by:
Hi All, I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.