Connecting Tech Pros Worldwide Help | Site Map

How to give input to a pvcs command automatically?

 
LinkBack Thread Tools Search this Thread
  #1  
Old October 26th, 2008, 03:41 PM
Newbie
 
Join Date: Sep 2008
Posts: 6
Default How to give input to a pvcs command automatically?

`vget <program name>` is a PVCS command which gets the program to our home directory. This command is given inside a perl program.

This command needs some input to be given.
Eg. Would you like to display milestone label (Y/N)?

We need to respond to this to get the program. Is there any way that i can give input to this automatically..? say N every time?.
Reply
  #2  
Old October 26th, 2008, 05:05 PM
numberwhun's Avatar
Site Moderator
 
Join Date: May 2007
Location: New Hampshire
Posts: 2,406
Default

Quote:
Originally Posted by nirsamp
`vget <program name>` is a PVCS command which gets the program to our home directory. This command is given inside a perl program.

This command needs some input to be given.
Eg. Would you like to display milestone label (Y/N)?

We need to respond to this to get the program. Is there any way that i can give input to this automatically..? say N every time?.
So this is an external command that you are executing inside of your Perl script using back tics. Ok, so if you want to feed it a variable or whatever you need to. Since you have the commands documentation, you need to look to see what it supports for input.

Regards,

Jeff
Reply
  #3  
Old October 26th, 2008, 05:33 PM
KevinADC's Avatar
Expert
 
Join Date: Jan 2007
Location: Southern California USA
Posts: 4,027
Default

Real generic example:

Expand|Select|Wrap|Line Numbers
  1. print "Would you like to display milestone label (Y/N)?";
  2. my $in = <STDIN>;
  3. chomp $in;
  4. # here you would check $in to make sure its what your program expects
  5. # and not just arbitrary input from the user that might be dangerous
  6. my $out = qx{vget $in};
  7. print $out;
  8.  
qx is the same as backticks
Reply
  #4  
Old October 29th, 2008, 09:29 AM
Newbie
 
Join Date: Sep 2008
Posts: 6
Default How to give input to a pvcs command automatically?

`vget <program name>` is a PVCS command which gets the program to our home directory. This command is given inside a perl program.

When this command is executed it needs an input to be given in the middle. We need to respond to the below question asked when the command is executed.
Would you like to display milestone label (Y/N)?

Only after we respond to this question the command will execute further. Is there any way that i can give input to this automatically..? say N every time?.
Reply
  #5  
Old October 29th, 2008, 01:08 PM
nithinpes's Avatar
Expert
 
Join Date: Dec 2007
Posts: 383
Default

Quote:
Originally Posted by nirsamp
`vget <program name>` is a PVCS command which gets the program to our home directory. This command is given inside a perl program.

When this command is executed it needs an input to be given in the middle. We need to respond to the below question asked when the command is executed.
Would you like to display milestone label (Y/N)?

Only after we respond to this question the command will execute further. Is there any way that i can give input to this automatically..? say N every time?.
You may give input to the question in the command prompt, even though the question may not get displayed.
But, if you want to set the reply automatically, you may make use of IPC::Run3 module.

-Nithin
Reply
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search


Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.