interaction with exec'ed process 
Author Message
 interaction with exec'ed process

I'm trying to convert a Bourne shell-script which serves as a front-end to
RCS to Tcl and have run into the following problem:

The script invokes various RCS commands using exec, like this:

      puts [exec ci $rcsfile]

but if the RCS command looks for user input (such as when a file is checked in),
the Tcl script appears to hang, apparently waiting for the completion of the ci
command, which never does because since the prompt for input from the ci does
not appear, the user never enters the needed data.

Any suggestions on how to handle this?
--
  =========================================

  (To reply:  remove Y from e-mail address)
  =========================================



Fri, 10 Jan 2003 03:00:00 GMT  
 interaction with exec'ed process

Quote:

>I'm trying to convert a Bourne shell-script which serves as a front-end to
>RCS to Tcl and have run into the following problem:

>The script invokes various RCS commands using exec, like this:

>      puts [exec ci $rcsfile]

>but if the RCS command looks for user input (such as when a file is checked in),
>the Tcl script appears to hang, apparently waiting for the completion of the ci
>command, which never does because since the prompt for input from the ci does
>not appear, the user never enters the needed data.

>Any suggestions on how to handle this?

                        .
                        .
                        .
Read the manual.

Do you already know at [exec] time what values you want the ci
process to see?  If so, then study up on [exec ci ... < $stuff]
and [exec ci ... << $other_stuff].

If not ... well, it depends.  When I've automated RCS, I've gen-
erally done so with Expect.  
--


Business:  http://www.Phaseit.net
Personal:  http://starbase.neosoft.com/~claird/home.html



Fri, 10 Jan 2003 03:00:00 GMT  
 interaction with exec'ed process

Quote:



>>I'm trying to convert a Bourne shell-script which serves as a front-end to
>>RCS to Tcl and have run into the following problem:

>>The script invokes various RCS commands using exec, like this:

>>      puts [exec ci $rcsfile]

>>but if the RCS command looks for user input (such as when a file is checked in),
>>the Tcl script appears to hang, apparently waiting for the completion of the ci
>>command, which never does because since the prompt for input from the ci does
>>not appear, the user never enters the needed data.

>>Any suggestions on how to handle this?
>                    .
>                    .
>                    .
>Read the manual.

I've been looking!

Quote:
>Do you already know at [exec] time what values you want the ci
>process to see?  If so, then study up on [exec ci ... < $stuff]
>and [exec ci ... << $other_stuff].

No.  I suppose I could prompt the user for input within the Tcl script
itself and then pass the data to ci as you suggest, but I would have
preferred just to use the RCS prompts directly...

Quote:
>If not ... well, it depends.  When I've automated RCS, I've gen-
>erally done so with Expect.  

The point is not so much as to automate RCS as to provide a wrapper which
handles various project-specific details, such as location of archive files,
manipulation of certain fields in the file headers, &c.

--
  =========================================

  (To reply:  remove Y from e-mail address)
  =========================================



Fri, 10 Jan 2003 03:00:00 GMT  
 interaction with exec'ed process

Quote:

> >If not ... well, it depends.  When I've automated RCS, I've gen-
> >erally done so with Expect.

> The point is not so much as to automate RCS as to provide a wrapper which
> handles various project-specific details, such as location of archive files,
> manipulation of certain fields in the file headers, &c.

This is the exact type of thing that expect can do with 'interact'.
It can drop
you out to the prompt to interact with rcs directly (if that is what
you want
to do).

--Dan



Fri, 10 Jan 2003 03:00:00 GMT  
 interaction with exec'ed process


                        .
                        .
                        .

Quote:
>> The point is not so much as to automate RCS as to provide a wrapper which
>> handles various project-specific details, such as location of archive files,
>> manipulation of certain fields in the file headers, &c.

>This is the exact type of thing that expect can do with 'interact'.
>It can drop
>you out to the prompt to interact with rcs directly (if that is what
>you want
>to do).

>--Dan

HOWEVER, it doesn't require Expect and its [interact] to do
what Mr. Parsons is after.  If I understand him correctly,
an invocation such as

might well be all he needs.  Moreover, he might be in a situ-
ation where he much prefers extension-free operation.
--


Business:  http://www.Phaseit.net
Personal:  http://starbase.neosoft.com/~claird/home.html



Sun, 12 Jan 2003 03:00:00 GMT  
 interaction with exec'ed process
On 26 Jul 2000 04:55:58 -0500,

Quote:




>                    .
>                    .
>                    .
>>> The point is not so much as to automate RCS as to provide a wrapper which
>>> handles various project-specific details, such as location of archive files,
>>> manipulation of certain fields in the file headers, &c.

>>This is the exact type of thing that expect can do with 'interact'.
>>It can drop
>>you out to the prompt to interact with rcs directly (if that is what
>>you want
>>to do).

>>--Dan

>HOWEVER, it doesn't require Expect and its [interact] to do
>what Mr. Parsons is after.  If I understand him correctly,
>an invocation such as

>might well be all he needs.  Moreover, he might be in a situ-
>ation where he much prefers extension-free operation.
>--

You are absolutely correct on both counts!  Thank you for your help.

--
  =========================================

  (To reply:  remove Y from e-mail address)
  =========================================



Sun, 12 Jan 2003 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. waiting for an exec'ed process to finish

2. Q: how to get pid of 'start'ed process (WNT, os.system)

3. Using import in an exec'ed string

4. return val of exec'ed prog

5. How to pass arguments to program been exec'ed

6. Redirecting output of a exec'ed application

7. Q: interacting with exec'ed commands ?

8. Capturing output from exec'ed command

9. chroot'ed demon process

10. parent-child's child process interaction

11. How to detect that an exec'd process has finished

12. cgi-bin "exec": error waiting for process to exit: No child processes

 

 
Powered by phpBB® Forum Software