merge stdin, stdout?

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Sat Feb 6 06:10:08 CET 2010


En Fri, 05 Feb 2010 17:39:07 -0300, jonny lowe
<jonny.lowe.12345 at gmail.com> escribió:
> On Feb 4, 8:20 pm, exar... at twistedmatrix.com wrote:
>> On 01:56 am, jonny.lowe.12... at gmail.com wrote:

>> >What I want is to have an easy way to merge input.txt and thestdout
>> >so that output.txt look like:
>>
>> >Enter a number: 42
>> >You entered 42.
>>
>> >Here, the first 42 is of course from input.txt.
>>
>> It sounds like you might be looking forscript(1)?
>
> $ script -c "./y < input.txt" output.txt
> Script started, file is output.txt
> gimme x:you entered hello
> Script done, file is output.txt

Try moving the redirection out of the command:

$ script -c ./y output.txt < input.txt

-- 
Gabriel Genellina




More information about the Python-list mailing list